Live data from Hacker News

Forth: The programming language that writes itself: The Web Page

ratfactor.com

81–89 of 89 posts

Re: Forth: The programming language that writes itself: The Web Page

#82
post #78
post #77

Earlier quoted context omitted.

I just take a look at third's source code. Looks interesting. When bootstrapping, kernel.com is called. OK, how did you build kernel.com?

I'm pretty sure I wrote the first version of kernel.com in assembler. Update: actually, more likely it was built using the meta compiler running on top of one of my previous Forths (I wrote a few). It's been too long to remember exact details, and I didn't use revision control back then. :-)

OK got it :)

Re: Forth: The programming language that writes itself: The Web Page

#83

Earlier quoted context omitted.

Did you forget what the OP asked? Is anyone using Forth in production? I very much doubt it.

You are probably using it yourself, right now. You just don't realize it because embedded stuff isn't sexy, won't make it to the blogosphere and just sits there doing it's job, year after year. Every vehicle, every boot of a larger machine probably uses FORTH at some stage. Not everything is web based and not everybody is part of the hype cycle. Since you're asking 'anyone' one example should be enough to satisfy you…

My impression so far is Forth development usually "limited" around hardware/embedded development. And for whatever reasons, seems like there are no much effort (?) to bring Forth to greater audiences (like us web/mobile dev apps, for example :D ).

Yes I know some folks are trying to change this, e.g:

- https://factorcode.org/

- https://8th-dev.com/

Re: Forth: The programming language that writes itself: The Web Page

#84

Forth was influential, but it is somewhere between obsolete and niche. It is much more difficult to program in than even raw C, let alone C++ and offers no advantage in speed on modern hardware where memory access is the by far the highest priority.

Well modern processors are optimized for running C code. Try running C code on a Forth processor and see how slow it is compared to Forth.

Re: Forth: The programming language that writes itself: The Web Page

#85

Forth was influential, but it is somewhere between obsolete and niche. It is much more difficult to program in than even raw C, let alone C++ and offers no advantage in speed on modern hardware where memory access is the by far the highest priority.

Well modern processors are optimized for running C code. Try running C code on a Forth processor and see how slow it is compared to Forth.

Forth on a modern CPU is still going to be much faster than C on a Forth processor. It isn't even true that modern processors are "optimized for C code", they have stack instructions that are very fast and directly apply to forth.

Re: Forth: The programming language that writes itself: The Web Page

#86

I remember hearing about a computer called the Jupiter Ace that used Forth. I think it was similar to the ZX Spectrum.

and there's a compatible kit available: https://www.thefuturewas8bit.com/shop/tynemouth-products/min...

Re: Forth: The programming language that writes itself: The Web Page

#87

Forth was influential, but it is somewhere between obsolete and niche. It is much more difficult to program in than even raw C, let alone C++ and offers no advantage in speed on modern hardware where memory access is the by far the highest priority.

It’s still great if you’re experimenting/prototyping new chips and SoCs. Forth REPL is great for that, but yes, niche.

Re: Forth: The programming language that writes itself: The Web Page

#88
post #48

Earlier quoted context omitted.

No, in some cases there were not. In addition, capitals served as a method of differentiation for language keywords and such.

Maybe worth to add that syntax highlighting was not a thing back then.

Not nearly enough cycles for that. Nor core memory. Nor even the possibility of colours or font styles. You were lucky if you got a timeslot for your program and didn't get preempted. You were even luckier if you got both uppercase and lowercase letters. (-:

* Nearly all this was before my time.

Re: Forth: The programming language that writes itself: The Web Page

#89

Earlier quoted context omitted.

Stack code can be mapped to register code trivially if you impose some restrictions (each word has a static effect and both branches of a conditional have the same effect). Then lowering to SSA form performs an “abstract interpretation” where evaluating a word pops SSA values from a “abstract stack”, creates an SSA node and pushes its output values on the stack.

I wouldn't say that sounds trivial exactl... > slavapestov ... ok, fair enough: it probably is trivial for you, lol. (For the uninitiated: Slava Pestov created Factor, a modern concatenatvie language which (IIRC) did a lot of innovative stuff regarding optimizations in that domain) [0] https://factorcode.org/slava/

He was the author of the jEdit editor too.
Post reply on HN