Rendered at 20:54:35 GMT+0000 (Coordinated Universal Time) with Cloudflare Workers.
veltas 10 hours ago [-]
I think the first question I've got for JavaScript Forths is how you'd handle addresses, bytes, etc., because that's a staple of any conventional Forth, necessary to create tables, arrays, and handle strings. There are lots of ways of doing it but there are some nasty compromises required for a more standard-looking Forth.
PaulHoule 6 hours ago [-]
A FORTH in Javascript should do what Clojure does for Java.
The object on top of the stack should be a Javascript value, numbers are all doubles, and you can use strings, arrays, objects-as-dicts and in fact ordinary objects you could write something like
You could use all the metaprogramming tricks you use in other FORTHs, be able to do anything Javascript can do, I don't think it would be too hard to unpack the stack and turn a word that takes N parameters from the stack into a Javascript function the JS compiler can make fast
and wonder if that could be harmonized with JS exceptions
This strategy though competes with writing a Lisp which gives you better metaprogramming.
terminalcommand 6 hours ago [-]
What about writing primitives using WASM?
jstanley 10 hours ago [-]
What about an array of numbers? What are the nasty compromises?
veltas 8 hours ago [-]
Well if the array of numbers are bytes then that has a pretty significant overhead, and losing a lot of performance for dealing with larger numbers or floats even. If it's not then you're complicating handling of strings and writing off most conventional forth code by not using byte addressing. Etc.
jstanley 7 hours ago [-]
A typical Forth machine has about 64k bytes of RAM, I don't think it's a big deal if you're running JavaScript anyway.
shakna 8 hours ago [-]
Some Forths work by directly writing machine code. You need to add a fair bit of machinery to be able to turn a JS number array into an executable piece of memory that can be hotpatched into other pieces.
jstanley 7 hours ago [-]
If you're making it in JavaScript then you won't be doing that anyway.
shakna 1 hours ago [-]
And doing it a different way, is the point I was making?
It comes with an overhead. You have to take a different architecture. You can't do things the same way.
jstanley 20 minutes ago [-]
That you can't execute machine code from JavaScript is a consequence of using JavaScript, not a consequence of using an array to store a bunch of numbers.
masoncarpenter 8 hours ago [-]
[dead]
bitwize 18 hours ago [-]
"Writing things in a programming language" now seems to have the same quirky old-internet charm as "Flash games".
pjmlp 11 hours ago [-]
Unfortunely, I forsee eventually LLMs will become good enough to deliver the 4GL initial vision, we are already seeing that take shape in iPaaS products, or code generation that is as readable as minified C code for IOCCC entries.
e12e 7 hours ago [-]
Why unfortunately - if they actually deliver?
I'm rather exited by the prospect that everyone will be a developer - and so actual users, not merely consumers, of computers.
pjmlp 7 hours ago [-]
It won't happen, a few lucky ones will press the buttons on the software factory machines, or be called into Wonka Factory (aka AI Labs), while everyone else has to find a new job.
conartist6 6 hours ago [-]
Yes, and as we all know the printing press was the dawn of a new era where nobody could read and write.
Fuckin' morons.
pjmlp 6 hours ago [-]
The printing press did nothing to literacy for those that could not attend school.
If anything, it allowed the creation of publishers as gate keepers of which books would be printed, and naturally placed the monks out of job doing beautiful renditions on the pages.
conartist6 5 hours ago [-]
Uh huh so I'm taking that as a "no" from you on the impact of the printing press as a technology over the last 500 years
e12e 6 hours ago [-]
Touch aggressive, no?
conartist6 5 hours ago [-]
Yes indeedy! Unfortunately all the placation work has been taken over by models.
boomlinde 4 hours ago [-]
"Not seeing a comment about LLMs on a HN item that has nothing to do with LLMs" now seems to have the same quirky old-internet charm as "marquee tags".
e12e 41 minutes ago [-]
Do you mean to say comments on LLMs - where not warranted - is about as welcome as marquee tags were?
Or do you genuinely feel such comments are missing?
I kind of agree with the first - and yet, I have an LLM related comment.
Just the other day I accidentally implemented a Forth - due to Google's LLM (search) result thingy - and its sort of interesting to contrast with this (ops) human written essay.
The object on top of the stack should be a Javascript value, numbers are all doubles, and you can use strings, arrays, objects-as-dicts and in fact ordinary objects you could write something like
You could use all the metaprogramming tricks you use in other FORTHs, be able to do anything Javascript can do, I don't think it would be too hard to unpack the stack and turn a word that takes N parameters from the stack into a Javascript function the JS compiler can make fastThere is some precedent:
https://www.forth.org/svfig/kk/11-2019-O'Connor.pdf
I just realized there is exception handling in FORTH now
https://forth-standard.org/standard/exception
and wonder if that could be harmonized with JS exceptions
This strategy though competes with writing a Lisp which gives you better metaprogramming.
It comes with an overhead. You have to take a different architecture. You can't do things the same way.
I'm rather exited by the prospect that everyone will be a developer - and so actual users, not merely consumers, of computers.
Fuckin' morons.
If anything, it allowed the creation of publishers as gate keepers of which books would be printed, and naturally placed the monks out of job doing beautiful renditions on the pages.
Or do you genuinely feel such comments are missing?
I kind of agree with the first - and yet, I have an LLM related comment.
Just the other day I accidentally implemented a Forth - due to Google's LLM (search) result thingy - and its sort of interesting to contrast with this (ops) human written essay.
https://hypertekst.net/forth/
Fair warning - my current homepage is an experiment drenched in AI - at best it's probably an acquired taste.
It's not intentionally terrible, however.