Forth thread

Forth thread
youtube.com/watch?v=6g4dkBF5anU
Official forth waifu: Rei Ayanami

forth.com/starting-forth/
repl.it/languages/forth
>This shit is easy as fuck to learn
>This shit is fast as fuck
>This shit can run on any computer, even old computers from the 1980's. You can get it down to less than a kilobyte.
This is some zen monk shit I pulled from the mountains,
Google is your friend
kiwiirc.com/client/irc.freenode.net/?nick=newuser|?#forth

Other urls found in this thread:

complang.tuwien.ac.at/forth/gforth/Docs-html/Object_002doriented-Forth.html#Object_002doriented-Forth
github.com/nornagon/jonesforth/blob/master/jonesforth.f
github.com/organix/pijFORTHos
osxbook.com/book/bonus/ancient/whatismacosx/arch_boot.html
twitter.com/SFWRedditImages

Functions are stupid. Words are where it's at.
: square ( a -- b ) dup * ;

what a beautiful square function. if only your commenting wasn't for shit

: square ( n -- n*n ) dup * ;

I don't understand why other forthers can't just write a comment that is actually a sentence explaining what something does and why it is doing it

A comment explaining the purpose goes above the definition. The spot after the name is for stack effect comments.

potential in using this to manipulate and/or produce video in real time?
how would one even go about that?

How do I output a number so that it's represented with four bytes?

I want to write a number to a file, but it needs to take up four bytes.

...

Should I learn this if the only reason I am interested is Rei?

no

In short, what are essential Forth commands? What is the bare minimum?

invent your own commands man. the only limit is you

Man, I have to have some basis to build my commands upon.

How does one implement forth interpreter in forth?

Well, you write a program that parses the source and then executes the commands

>captcha: fourth york

Forth as a language looks great.
But I wonder:
1. Is there some modern appliances of the Forth?
What devices Forth empowers?
2. Is there OOP Forth? Or OOP Forth is useless?

Why can't people accept that not all languages need to be OOP or have an OOP version?

But how muh abstraction, encapsulation, inheritance and polymorphism, how am I going to live without them?

>modern appliances
Check yourself.

>Is there OOP Forth?
I don't think ANS Forth has OOP, but some implementations do.
complang.tuwien.ac.at/forth/gforth/Docs-html/Object_002doriented-Forth.html#Object_002doriented-Forth

Yeah, if only he had asked "Or OOP Forth is useless?". Oh wait, he did.

But he shouldn't even be asking, since OOP is useless regardless of the language

best girl

There is no better paradigm than OOP when it comes to making enterprise scale project in enterprise scale team made of enterprise-quality developers.

Forth is about the only programming language that you can implement a full interpreter by hand in a couple hundred lines of assembly

JonesForth is a tutorial that is itself assembly source code that will compile to a working Forth compiler, the tutorial text is in comments
github.com/nornagon/jonesforth/blob/master/jonesforth.f

Here is a baremetal implementation of Forth that runs on the raspi
github.com/organix/pijFORTHos

and that's why all enterprise scale software is sooo great and well made today

The firmware interface on old Sun gear uses Forth. It's neat if you're into exploring new languages for fun, but otherwise not much use.

oo, so like a type signature?

>The firmware interface on old Sun gear uses Forth.
its called OpenFirmware and its built into the bios of Mac OSX
osxbook.com/book/bonus/ancient/whatismacosx/arch_boot.html

I was under the impression that they've dumped openfirmware in favor of uefi.

probably....that article is dated 2003, so I guess its not in Macs anymore

Not really, it doesn't type check or anything. It's supposed to document how many items on the stack are going to be removed and added and what is their type

>implying you've ever worked with enterprise-scale software

They don't have to be perfect. They have to be good enough to make most money with least cost.

Fuck yeah Forth. And how about ColorForth and how about a sweet GreenArrays fucking 144-core CPU to run it on. Picoamperes.