Live data from Hacker News

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

ratfactor.com

51–60 of 89 posts

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

#52
post #47

My first programming languages were x86 assembly and Forth. My Dad was into Forth, and I learned programming from him. I wrote several x86 Forth systems for DOS as a teenager, culminating in a somewhat-polished ANS compatible one I called "Third": https://github.com/benhoyt/third -- it's kind of amazing being able to have a fully bootstrapped Forth compiler (including an assembler) in a couple thousand lines of code.…

> but the stack manipulation quickly gets tedious

it might just be that you (and i) are not chuck moore. his code generally has very little stack shuffling. e.g.

http://www.merlintec.com/download/color.html

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

#53

I have implemented yet another forth by myself. It works a little bit different and it is not intended to be a true copy of the original idea. Since the post says you can discover Forth, here's my part: https://github.com/loscoala/goforth The main difference is that in this Forth variant, the source text is completely translated into bytecode and there is no runtime in the sense of classic Forth. This makes it easy t…

That can be very productive and clever, but be - and stay - aware that such polyglot solutions tend to be maintenance headaches in the longer run. There is a really nice open source project out there that allows you to train your hearing and your sightreading, but it's written in the authors own language which in turn compiles to JavaScript and the headache to set up their toolchain is such that I haven't bothered fi…

It's a little strange to talk about moonscript as something obscure, luarocks the main package manager for lua is written in it, not to mention itch.io. It's a proven language that's at least easier to learn than lua. (well, its at least more programmer friendly)

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

#54

Earlier quoted context omitted.

yeah apologies, I can't edit my comment now or I would

I got the gist of it though, and I think you do have a point: FORTH showed the power of stack machines (and the HP calculators of course did too) in a way that not much else did and I'm pretty sure that the ease with which you can bring one up to bootstrap a new environment is part of the reason why they were (and still are) more popular than many people realize for embedded stuff and first silicon of new and experim…

Stack machines are really interesting. And Forth also had creative ways to think about code.

I still need to read http://fpgacpu.ca/publications/Second-Generation_Stack_Compu... (amongst others)

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

#55

Earlier quoted context omitted.

I got the gist of it though, and I think you do have a point: FORTH showed the power of stack machines (and the HP calculators of course did too) in a way that not much else did and I'm pretty sure that the ease with which you can bring one up to bootstrap a new environment is part of the reason why they were (and still are) more popular than many people realize for embedded stuff and first silicon of new and experim…

Stack machines are really interesting. And Forth also had creative ways to think about code. I still need to read http://fpgacpu.ca/publications/Second-Generation_Stack_Compu... (amongst others)

A very interesting chip was the NOVIX: https://en.wikichip.org/wiki/novix/nc4016

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

#56

As soon as I met Forth, I felt I had to hack my own ( https://github.com/ttsiodras/MiniForth/ ) - and did so over a single week, two years ago. I targeted the Blue Pill and the original Arduino, but developed via cross-compilers so that I could test my code in the host. I became so obsessed with the project that I was looking forward to tinkering with it after coming back from work every day; so it was hacked in 5 ev…

> I became so obsessed with the project that I was looking forward to tinkering with it after coming back from work every day; so it was hacked in 5 evenings and a weekend. It was that much fun, to build a Forth. Yep. In my computer architecture class as a freshman, we were supposed to do a final project of our choosing for the LC-3 (a RISC instruction set with emulator). I had dabbled briefly in Forth (with the RedP…

In terms of practical usage, FYI both bitcoin script and postscript (for printers) are Forth based, as are some aerospace chips.

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

#57
post #53

Earlier quoted context omitted.

That can be very productive and clever, but be - and stay - aware that such polyglot solutions tend to be maintenance headaches in the longer run. There is a really nice open source project out there that allows you to train your hearing and your sightreading, but it's written in the authors own language which in turn compiles to JavaScript and the headache to set up their toolchain is such that I haven't bothered fi…

It's a little strange to talk about moonscript as something obscure, luarocks the main package manager for lua is written in it, not to mention itch.io. It's a proven language that's at least easier to learn than lua. (well, its at least more programmer friendly)

Sorry, but it just doesn't cross my threshold for 'mainstream', whereas Lua does at least get within striking distance.

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

#58
post #47

My first programming languages were x86 assembly and Forth. My Dad was into Forth, and I learned programming from him. I wrote several x86 Forth systems for DOS as a teenager, culminating in a somewhat-polished ANS compatible one I called "Third": https://github.com/benhoyt/third -- it's kind of amazing being able to have a fully bootstrapped Forth compiler (including an assembler) in a couple thousand lines of code.…

> a somewhat-polished ANS compatible one I called "Third"

Or should Forth++ == Sixth

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

#59
post #38

If you wonder: How does it write itself? Isn’t it just the ability to write functions? In a way, yes, but it's a bit more than that. Many programming languages allow you to define functions or methods, but Forth takes this concept further by allowing you to define new "words" that can become part of the language itself. These words can be used just like built-in operations, and they can even change the way the langua…

Neat, I suppose, but... In nearly 40 years as a professional programmer, the problem has never been the syntax. It's always the semantics. (I mean, yes, if you're doing something like matrix multiplication it's nicer to be able to say A = B + C * D; rather than having to explicitly spell out which functions you're calling. I have never actually hit that situation, though.)

Do I just lack imagination?

Is this domain-specific, and I've just never been in the domain where it was useful?

Is Forth so crippled in syntax that you need to be able to extend it to make it something more useful?

Do people just want to be able to customize their language, the way some people do their cars?

Why do people really care about this?

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

#60

Why did some ancient programming languages emphasize on CAPITAL LETTERS? Was there no "Shift" button on keyboards back then?

The Apple II computers, for example, had only upper-case characters in ROM (and screens were 40 characters wide). Lower -case characters would have required a second ROM, which obviously increased costs. Eventually models with lower-case capabilities were added, as was 80-column output.
Post reply on HN