[HN Gopher] Show HN: Particles - the URL contains the whole prog...
       ___________________________________________________________________
        
       Show HN: Particles - the URL contains the whole program code
        
       Author : chkas
       Score  : 46 points
       Date   : 2022-06-26 12:07 UTC (10 hours ago)
        
 (HTM) web link (easylang.online)
       20or%20px%20%3C%200%0A%20%20%20%20%20%20pvx%5Bi%5D%20%3D%20-pvx%5Bi
 (TXT) w3m dump (easylang.online)
        
       | chkas wrote:
       | Another demo:
       | 
       | https://easylang.online/run/?code=%23%20Mastermind%3Aw90%0A%...
        
       | [deleted]
        
       | rambambram wrote:
       | Wow, very friendly and welcoming UI/UX that quickly makes me try
       | out stuff. It looks simple but the flow is very polished. Good
       | job! P.S. Do you have more plans for this app? I see there's
       | tutorials on programming.
        
         | chkas wrote:
         | Thanks. The main motivation was to develop a programming
         | language for beginners. The code runner, the web apps, and the
         | various tutorials were created kind of on the side.
        
       | mkoryak wrote:
       | Cool, but why are the variables named like you are trying to
       | conserve memory? I understand `dx` and `dy`, but `thres` and
       | `n_part` ?
        
         | chkas wrote:
         | For me the code is more maintainable if the variable names are
         | not too long. (thres = threshold, n_part = number of particles)
        
       | Natfan wrote:
       | In case anybody would like to view the source, see below (via
       | PowerShell[0]):                   $Post = Invoke-WebRequest -URI
       | "https://news.ycombinator.com/item?id=31883209" -UseBasicParsing
       | $Link = $Post.Links.Where{$_.href -like
       | "https://easylang.online/run/?code=*"}.href         $EncodedCode
       | = $Link -replace "https://easylang.online/run/\?code=(.+)",'$1'
       | $Code = [Web.HTTPUtility]::URLDecode($EncodedCode)         Write-
       | Output $Code
       | 
       | [0]: https://github.com/PowerShell/PowerShell, note that Windows
       | PowerShell 5.x is installed on most Windows systems by default.
        
         | chkas wrote:
         | Or you click on "Code" on the web page.
        
       | fastball wrote:
       | Partly this is doable because although RFC 2616 (HTTP/1.1)
       | specifies a max URL length of 2048 bytes, all the major browsers
       | will process URLs which are much longer, with Safari allowing URL
       | strings _up to 2GB in size!_ [1]
       | 
       | In 2021 probably one of the bigger blockers of giant URLs is
       | CDNs, which impose various limits on URL size. e.g. Cloudflare
       | limits URLs to 16kb.
       | 
       | [1] https://github.com/apple/swift-corelibs-
       | foundation/blob/b23d...
        
         | mmastrac wrote:
         | Using fragments instead of query strings bypasses CDN limits,
         | but obviously those are going to be a lot more fragile in
         | general.
        
       | jansan wrote:
       | THe URL is 1548 character long, which is below the "safe" length
       | limit for URLs of 2058 characters. With Internet Explorer gone,
       | URLs of up to 8192 chars length should work on all browsers.
       | 
       | https://stackoverflow.com/questions/417142/what-is-the-maxim...
        
       | reneberlin wrote:
       | flems.io (lightweight online html, js,css editor) does this also.
       | i was very impressed, when i first encountered this. Everything
       | is encoded in the url to share.
       | 
       | https://flems.io/#0=N4IgzgpgNhDGAuEAmIBcIB0ALeBbKIANCAGYCWMY...
       | 
       | cryptpad does the same, i read yesterday. https://cryptpad.fr/
        
         | chkas wrote:
         | URL parameters starting with # sound interesting, since they
         | are obviously not sent to the server.
        
           | chkas wrote:
           | I looked it up: "#" is the location.hash and sets the anchor
           | part of a URL. And is probably perfect for client side
           | parameters, which is what I need. Such a discussion on HN is
           | really often very helpful. There was a comment here that
           | unfortunately got deleted again before I could reply that
           | mentioned that.
        
         | [deleted]
        
       | memalign wrote:
       | Here's a list of example programs:
       | 
       | https://easylang.online/run/list.html
       | 
       | Also reminds me of this:
       | 
       | https://viz.intelligence.rocks/
        
       | cmp2tio wrote:
       | How is this different from Try It Online https://tio.run ?
        
         | chkas wrote:
         | It runs in the browser using WASM, not on the server. And it is
         | a beginner-friendly programming language.
        
       | golf_mike wrote:
       | What am I missing? the URL is just https://easylang.online/run/
       | 
       | --edit-- ah its in the link, which then is not visible in the
       | address bar anymore. Got it :)
        
       ___________________________________________________________________
       (page generated 2022-06-26 23:01 UTC)