
Show HN: An Easy Programming Language That Runs in the Browser - chkas
https://kabas.online/
======
chkas
What'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.

~~~
mbel
> 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.

~~~
wrs
I believe the philosophy of C++ is that features _you don’t use_ should have
zero _runtime_ cost.

~~~
chkas
The C++ runtime library needs space in the wasm file.

------
nine_k
The 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
JavaScript 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
It'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
That 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.

~~~
vanderZwan
While certainly related, I think GP was suggesting more that the same idea
also applies to ease of development rather than raw hardware power.

~~~
MrEldritch
I think that the raw-hardware-power aspect is actually a _special case_ of
ease of development - in that case, it's the ease of not having to think about
low-level consequences of your abstractions or spend effort on optimizing your
code!

~~~
vanderZwan
Fair point!

------
KennyCason
I’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.

------
Aardwolf
Nice! It would be more fitting for the style of this language if 'end' were
used instead of '.' imho

~~~
chkas
`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
I'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
Erlang also uses the . to end statements.

------
Kaveren
I 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.

~~~
tobyhinloopen
Lua might have little features and have a small footprint, but it's not simple
to understand

~~~
DarkWiiPlayer
That'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.

------
ranit
Reminds 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
I 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.

------
VictorSCushman
Really cool. Is there a project repository, and are you accepting
contributions?

~~~
chkas
Not yet

------
z92
Great! Brings back the simplicity of Basic and QBasic. How easy it was to
draw, animate and create music.

------
abenedic
The source is actually pretty readable, do you have a git repository anywhere
so others can contribute?

------
arayh
Nice 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
Look 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%...](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).

[2] [http://pieroxy.net/blog/pages/lz-
string/index.html](http://pieroxy.net/blog/pages/lz-string/index.html)

------
v01d4lph4
Impressive! But why?

~~~
chkas
There are so many programming languages - but imho not a real easy one for
beginners.

~~~
thanatropism
Python?

Python is really easy to learn and has reached VB levels of snowball network
effects.

~~~
wowtip
But even Python requires installing the dev environment etc. I can see the use
for this, for throwing people with no experience into "coding right away".

~~~
tokai
There exists several python web environments.

[https://www.pythonanywhere.com/try-
ipython/](https://www.pythonanywhere.com/try-ipython/)

[https://repl.it/](https://repl.it/)

[https://trinket.io/python](https://trinket.io/python)

------
onemoresoop
Fantastic work. Hope it finds its niche and grows

------
Micoloth
Very cool, both the graphics capabilities and the fact that it's Wasm!

Is this project open source?

------
RickJWagner
Cool! Thanks for sharing.

------
pmarreck
There should be something like this except functional/immutable

~~~
chkas
Many design decisions are based on keeping the language simple in syntax and
semantics.

~~~
pmarreck
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"

~~~
davegauer
I 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
Now 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.

------
agumonkey
much logo

