News for hackers. Stuff that matters.
Re:Forth – The Early Years (1991) by nabeshima on Monday August 31, 2015 @08:00AM (#10146399)
Today, what is the typical software one would build with Forth? What are the libraries like?
Re:Forth – The Early Years (1991) by jamesbowman on Monday August 31, 2015 @10:43AM (#10147002)
I write Forth code for tiny microcontrollers that are embedded in ASICs. They are ROM-based, and have to work first time. Size is a few hundred bytes, so C is out of question.
Re:Forth – The Early Years (1991) by pgeorgi on Monday August 31, 2015 @08:43AM (#10146540)
firmware, boot loader, 1980's text editors.

As for libraries: Usually that boils to "No."

To quote: "The conventional approach, enforced to a greater or lesser extent, is that you shall use a standard subroutine. I say that you should write your own subroutines." (http://www.forth.com/resources/evolution/evolve_1.html)

Re:Forth – The Early Years (1991) by anon4 on Monday August 31, 2015 @08:48AM (#10146560)
I've heard good things about Factor - another stack-based language, which is more high-level than Forth, but I've never used it.
Re:Forth – The Early Years (1991) by bandrami on Monday August 31, 2015 @09:59AM (#10146807)
I wrote the OS for my Raspberry Pi in Forth (which necessarily meant writing the interpreter).

I think that's an important thing: anybody who's seriously doing Forth work has written his or her own interpreter to do it with. Which may be as it should be.

Re:Forth – The Early Years (1991) by bucma on Monday August 31, 2015 @10:32PM (#10150370)
Any chance that you've put the code out there somewhere? I'd love to see it.
Re:Forth – The Early Years (1991) by muyuu on Monday August 31, 2015 @11:20AM (#10147199)
Interestingly, Bitcoin and similar systems use a Forth-like stack language as script.

For instance, a typical transaction goes like this:

[scriptSig] [scriptPubKey]

Where scriptSig is: __signature__ __public_key__

and scriptPubkey is: OP_DUP OP_HASH160 __some_hash__ OP_EQUALVERIFY OP_CHECKSIG

In rough terms:

OP_DUP works like classic Forth DUP, duplicates the immediate stack element. OP_HASH160 replaces the stack element with its hash160. OP_EQUALVERIFY performs a "fail if not equal" and OP_CHECKSIG takes two elements from the stack and verifies they're a pubkey and its signature.

So basically that's how the system verifies that a transaction is signed by the owner of the input address to go to the owner of the output address.

Re:Forth – The Early Years (1991) by fra on Monday August 31, 2015 @12:16PM (#10147495)
The bootloader for Sparc systems @ Sun is still OpenBoot, written in Forth: https://en.wikipedia.org/wiki/Open_Firmware

I worked on it a bit, though it doesn't change much beyond bug fixes these days.

Peripheral vendors still routinely provide FCode drivers in the server space.

Re:Forth – The Early Years (1991) by laumars on Monday August 31, 2015 @08:07AM (#10146421)
I wouldn't say this was it's "typical" usage, but the only time I personally have written Forth was when editing FreeBSD bootloader:

https://www.freebsd.org/cgi/man.cgi?query=loader%288%29

Re:Forth – The Early Years (1991) by cartoonfoxes on Monday August 31, 2015 @01:34PM (#10147975)
Embedded systems. Forth makes for a pretty sweet environment for interactive driver development.
Re:Forth – The Early Years (1991) by coliveira on Monday August 31, 2015 @09:14AM (#10146631)
You can write pretty much anything you want. The problem is that the standard Forth has very few libraries, and most libraries around depend on a particular implementation. To see what is possible, check Win32Forth for example.
Re:Forth – The Early Years (1991) by RodgerTheGreat on Monday August 31, 2015 @12:00PM (#10147416)
You could write videogames: https://github.com/JohnEarnest/Mako