Earlier quoted context omitted.
> 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.
I believe the philosophy of C++ is that features you don’t use should have zero runtime cost.
Show HN: An Easy Programming Language That Runs in the Browser
71–80 of 91 posts
Re: Show HN: An Easy Programming Language That Runs in the Browser
#72Earlier quoted context omitted.
Many design decisions are based on keeping the language simple in syntax and semantics.
I 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"
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!
Re: Show HN: An Easy Programming Language That Runs in the Browser
#73Re: Show HN: An Easy Programming Language That Runs in the Browser
#74What'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.
Re: Show HN: An Easy Programming Language That Runs in the Browser
#75Earlier quoted context omitted.
There are so many programming languages - but imho not a real easy one for beginners.
Python? Python is really easy to learn and has reached VB levels of snowball network effects.
Re: Show HN: An Easy Programming Language That Runs in the Browser
#76Nice! It would be more fitting for the style of this language if 'end' were used instead of '.' imho
`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.
Re: Show HN: An Easy Programming Language That Runs in the Browser
#77Earlier quoted context omitted.
There are so many programming languages - but imho not a real easy one for beginners.
Python? Python is really easy to learn and has reached VB levels of snowball network effects.
Don't get me wrong, I like Python. If you're a non-programmer and you want to start programming, and you want to be useful and to be able to automate stuff quickly, you should learn Python.
Especially where math and statistics stuff is concerned -- I have a friend who recently started programming, and Python was his entry point. Unfortunately, the environment problems that everyone says are solved are still a pain. I had to troubleshoot his setup a lot; in particular it was a pain to make sure that if he called `python` from the command line it would be the same version as his IDE.
And Python as a language is just kind of big. It's the same problem that Javascript suffers from -- sure, you can learn just the basic stuff, but will that help you when you're looking at other people's code online? Will that help you if you're checking out an OS project? That kind of ecosystem matters for accessibility.
Both Python and Javascript have this philosophy of "there should be a library for everything". But what that means is that there's a ton of extra stuff just floating around, and no matter how much you tell people to ignore it, they don't. It's not a bad thing, in a lot of ways it's a very good thing. But it has consequences.
Python adds onto that with the idea that everything should be readable. So there are multiple ways to iterate over an array, and the syntax sometimes subtly changes so the code looks cleaner. These are, again, not bad things. But they have consequences. They increase the number of concepts you're wrapping your head around. Compare Python with TI-83 Basic. A much, much smaller standard library that you can teach even a brand new programmer in like, a month. A few interesting restrictions (limited variables) that subtly push towards more advanced concepts (I learned how pointers worked on the TI-83 before I know what the word meant).
I think this is why people gravitate towards platforms like the Pico-8. There's something refreshing about being in a bounded environment where all of the concepts are kept small. Learning to program for the first time is about experimenting and learning to go in depth with a couple of concepts, not learning a wide variety of concepts.
That friend I was talking about eventually went back to doing a lot of programming in Excel instead of Python. Python was more powerful, and he played with it a bit, but he has an entire grasp around how cells in Excel interact with each other, so he's able to do creative stuff by just thinking about the stuff he already knows. He can write a program on paper without being at a computer. In contrast, when he wanted to do something creative in Python, he had to go Google "how do I do X"?
Re: Show HN: An Easy Programming Language That Runs in the Browser
#78Earlier quoted context omitted.
> 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.
Size doesn't count?
For server/desktop delivery, which is C++ original and major domain, for which those "costless abstractions" were developed, no.
It's not like Stroustrup, Stepanov and co had web assembly and constrained mobile devices loading webpages in mind when designing C++.
The idea of "costless abstractions" was about them not losing runtime speed -- not costless in code size. So the parent's comment doesn't really apply.
Re: Show HN: An Easy Programming Language That Runs in the Browser
#79Nice! It would be more fitting for the style of this language if 'end' were used instead of '.' imho
`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.
Just my 2c
Re: Show HN: An Easy Programming Language That Runs in the Browser
#80Nice! It would be more fitting for the style of this language if 'end' were used instead of '.' imho
`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.