9 ms·
Show HN: An Easy Programming Language That Runs in the Browser
- Aardwolf 8y agoNice! It would be more fitting for the style of this language if 'end' were used instead of '.' imho
- chkas 8y ago`end` as block delimiter makes much noise. Python code looks clean because it only uses indentations to delimit blocks. But this makes it at least difficult to refactor the code and to reformat it automatically.
- vanderZwan 8y agoI'm not sure why you are downvoted. Your statement is just an opinion, but it's your language and you are perfectly entitled to aesthetic judgements like that. The . kind of reminds me of Smalltalk, which uses it to end statements (instead of the ; we all know from other languages at the time)
- pmarreck 8y agoErlang also uses the . to end statements.
- coder543 8y agoFrom my experiences working with beginners, I think the keyword "end" would be more clear to them. It would be great to have it as a synonym for ".", if nothing else. I think we can all agree that what constitutes "line noise" is pretty subjective.
- oliv__ 8y agoI agree with the parent, but for visual reasons: I think the dot is easily missed/forgotten when quickly glancing at your code, and that there is a visual imbalance between a 5 character starting statement (while) and a single character to end the block (the dot likely being the tiniest character available on top). Just my 2c
- hcs 8y agoIt's an interesting compromise, I think you've done a good job with it.
- v01d4lph4 8y agoImpressive! But why?
- chkas 8y agoThere are so many programming languages - but imho not a real easy one for beginners.
- thanatropism 8y agoPython? Python is really easy to learn and has reached VB levels of snowball network effects.
- jerf 8y agoWell... it was easy to learn. It really isn't easy to fully learn it as it used to be. I think there's a fundamental gulf between "easy language" and one that you'd want to do work in long term, and the history of Python is a great case study in that. If there aren't any "easy, real languages", well, if you want to fix that you'd better carefully study the reasons why all the easy languages have stopped being easy on their way to becoming real languages or you'll just repeat the mistakes of the past.
- publicfig 8y agoWhat do you think makes Python more difficult to learn now than it used to be? It seems to me that there are even more tutorials now. Also, the confusion between learning 2.7 or 3+ is pretty much completely gone at this point, while the base core of the language remains as simple and readable as the older version in my opinion.
- zephyrfalcon 8y agoI don't think the number of tutorials matters, otherwise Haskell monads would be super easy to learn. ;-) Python circa 2000 was a language that was easy to learn. [1] What you saw was basically what you got. Python in 2018... well... it has grown lots more features, which might not show up in tutorials but a beginner will see them as soon as they look at actual code. List comprehensions, generators, context managers, metaclasses, async/await, decorators, 2/3 split, ABCs, etc. Useful? Yes. Easy to learn or understand for a newbie? Maybe not so much. Never mind that setting up an environment is no longer as easy as creating a 'lib' directory somewhere in $PYTHONPATH and unzipping files in there. Now we have many package managers, virtual environments, competing Python versions, you name it. Back in the day I started a Python "project" with a single file and worked from there, growing as necessary. Nowadays I see new projects with a dozen files and directories. Again, there are (presumably) reasons for all this, but easier it certainly is not. [1] Although even then the "Programming Python" book was like 900 pages... http://shop.oreilly.com/product/9781565921979.do http://shop.oreilly.com/product/9781565921979.do
- VictorSCushman 8y agoReally cool. Is there a project repository, and are you accepting contributions?
- chkas 8y agoNot yet
- z92 8y agoGreat! Brings back the simplicity of Basic and QBasic. How easy it was to draw, animate and create music.
- nine_k 8y agoThe original Javascript was intended as an easy language that runs in the browser. And so it was in 1996. In reality, it seems, a successful language that runs in the browser had no way around becoming a "full-blown" language, as opposed to "easy".
- bartread 8y agoJavaScript still can be easy if you ignore the rest of the ecosystem. Thing is, sooner or later, at the very least you find yourself wanting something like lodash or jQuery[1]. Ironically, the latter also came into existence to make programming across different browsers simpler back in the bad old days (of not that long ago), and did an admirable job of that. Unfortunately jQuery, and similar libraries of the mid-noughties era, provided the breach in the dam that's seen us swamped in a torrent of new, sometimes baffling, and on occasion arguably unnecessary platforms, libraries, and tools, which have made the process of developing for the client a much more intimidating process for those starting out. [1] Although these days you'd be surprised by how much of what jQuery offered is now built into the browser APIs and works consistently across them.
- mediumdeviation 8y agoIt's Jevon's Paradox [1] applied to the browser, where increasing the efficiency in which the browser can be scripted paradoxically causes websites to become slower and harder to build. Not because JavaScript itself (or any of the libraries built on top it) got worse, but because by allowing developers the ability to script more and more complex applications, sites became slower, and developer tools became heavier to support these more complex demands. [1]: https://en.wikipedia.org/wiki/Jevons_paradox https://en.wikipedia.org/wiki/Jevons_paradox
- sephware 8y agoThat sounds similar to Wirth’s Law. In general the more efficient a computer’s hardware is, the more bloated its software will be, so the slower the whole system will run.
- Kaveren 8y agoI think there's more value to be had in building better learning resources around programming languages than continually trying to simplify them at the expense of power. Besides that, if someone is already looking for a simple scripting language, Lua already exists. I personally prefer its syntax as well.
- abenedic 8y agoA person might make a language so they can learn to make a language. How could Lua exist if a person had no idea the tradeoffs in implementing various languages? You do not know the person's reasons.
- Kaveren 8y agoYou're absolutely correct, and making your own programming language implementations to generally improve as a programmer, for fun, or to get better at implementing programming languages is great. It can become a daunting task very quickly. I was basing the person's reasoning after the original poster's reply: > There are so many programming languages - but imho not a real easy one for beginners.
- tobyhinloopen 8y agoLua might have little features and have a small footprint, but it's not simple to understand
- DarkWiiPlayer 8y agoThat's only half-true. Understanding all of Lua is hard, specially if you want to get into optimizing your code, but for simple tasks it's an incredibly easy to learn language. That being said, it really depends on the resources you're using to learn; Tutorials meant for programmers that bombard you with slang and exotic concepts will confuse newcomers.
- deleted 8y ago[deleted]
- 8y ago
- abenedic 8y agoThe source is actually pretty readable, do you have a git repository anywhere so others can contribute?
- chkas 8y agoWhat's under the hood? The source code is parsed to an AST, which is then executed. It began with a Java-Applet. When WebAssembly appeared, I ported it to C++ with a JS/HTML interface and added graphics. Recently I converted the C++ part to C, which halved the size of the wasm file.
- soapdog 8y agoReally liked that! Congratulations on your work, it is very inspiring. I am also trying to build small languages, for fun, I think the web could use more languages. One example that is quite amazing in my opinion is Pyret, I think you might like it, check it out at https://www.pyret.org https://www.pyret.org
- mbel 8y ago> Recently I converted the C++ part to C, which halved the size of the wasm file. So you are saying that "costless" abstractions of C++ actually had some cost? Who would have thought.
- deleted 8y ago[deleted]
- wrs 8y agoI believe the philosophy of C++ is that features you don’t use should have zero runtime cost.
- coldtea 8y ago>So you are saying that "costless" abstractions of C++ actually had some cost? Who would have thought. Size obviously doesn't count. Obviously abstractions will produce more code.
- agumonkey 8y agomuch logo
- ranit 8y agoReminds me of the old educational graphics programming language Logo. https://en.wikipedia.org/wiki/Logo_(programming_language) https://en.wikipedia.org/wiki/Logo_(programming_language)
- xori 8y agoI grew up with Turing, which was nice later in life because it resembled pseudo code pretty closely. https://en.wikipedia.org/wiki/Turing_(programming_language) https://en.wikipedia.org/wiki/Turing_(programming_language) I think the best teaching language is one that can have a ball bouncing across the screen with as little ceremony as possible.
- pmarreck 8y agoThere should be something like this except functional/immutable
- chkas 8y agoMany design decisions are based on keeping the language simple in syntax and semantics.
- pmarreck 8y agoI have found that immutability is actually simpler to understand (and, potentially related, results in fewer bugs per LOC written), it's just that everyone's (including mine!) first language is usually procedural/mutable so that seems to be what is "easy"
- davegauer 8y agoI can't fathom why you've been downvoted. I think you're absolutely correct: there's nothing "obvious" about either flavor. It's really clear, in hindsight, why we started out with mutability (and self-modifying code and all sorts of "crazy" bit-twiddling goodies from the age of hardware-specific software). But I don't think it takes too much imagination to envision a world in which immutability becomes the default, even (or especially) for beginners!
- pmarreck 8y agoNow that RAM is relatively cheap and garbage collection algos are pretty decent, immutability should be the default, because it eliminates an entire class of bugs while enabling benefits like "easy" lock-free concurrency, etc. Here's a project I'm excited about, I think it's the first fully-functional/immutable/declarative cross-platform GUI library in existence https://github.com/boydm/scenic https://github.com/boydm/scenic Still pretty rudimentary but has made great strides in a year and the demo is pretty amazing (especially given how NOTORIOUSLY gui toolkits are typically OOP/procedural/mutable) https://www.youtube.com/watch?v=1QNxLNMq3Uw https://www.youtube.com/watch?v=1QNxLNMq3Uw Boyd Multerer got famous via Xbox Live.
- KennyCason 8y agoI’m a huge fan of these sorts of simple programming languages. I consider the simplicity of Purebasic and TI-83/89 Basic to be one of the main reasons I was able to successfully get into programming in high school despite not having any programming classes. I was also simultaneously learning x86 ASM and while that was also super fun, my Basic programming was far ahead of my ASM. Being able to successfully build simple games in Basic is extremely motivating when learning to code.
- onemoresoop 8y agoFantastic work. Hope it finds its niche and grows
- nosjwshere 8y agodoes this compile into js or wasm? I was looking into something like this to separate business logic from architecture. you could use this to bind react components together for example.
- arayh 8y agoNice work! I would love it if we could get something like a codepen.io for this language, so we could share and debug code with people learning to program.
- vanderZwan 8y agoLook under "More Features" of the main website[0][1]. > kabas.online can be opened passing a programm within an URL parameter If the author of the language reads this: you could try shortening the URL with LZString[2]. [0] https://kabas.online/main.html https://kabas.online/main.html [1] https://kabas.online/run.html?title=Run&code=sz%20%3D%20100%0Acolor%20900%0Awhile%20x%20%3C%2050%0A%20%20move%20x%20x%0A%20%20line%20x%20%2B%20sz%20x%0A%20%20line%20x%20%2B%20sz%20x%20%2B%20sz%0A%20%20line%20x%20x%20%2B%20sz%0A%20%20line%20x%20x%0A%20%20sz%20-%3D%2010%0A%20%20x%20%2B%3D%205%0A https://kabas.online/run.html?title=Run&code=sz%20%3D%20100%.... [2] http://pieroxy.net/blog/pages/lz-string/index.html http://pieroxy.net/blog/pages/lz-string/index.html
- RickJWagner 8y agoCool! Thanks for sharing.
- Micoloth 8y agoVery cool, both the graphics capabilities and the fact that it's Wasm! Is this project open source?
- vippy 8y agoWhy an imperative, procedural language though?