FORTH

That's not so much different than getting used to the implicit variables like $_ and @_ in Perl.

Those variables are globals and have a very specific purpose. Forth variables can't even be seen, they're implicitly allocated on the stack and don't even have a name in the code.


I don't get it...

There's no k l m n o p access to loop indexes. The student's code would've needed very non-portable hacks to N-OVER the values from the return stack and produced Yandere-level code. The second way only needs the programmer to think about 'i'--and all on the same line. It's the sort of thing that crops up in larger programs, and FORTH somewhat introduced the 'structured programming' idea, albeit in RPN...

Maybe you can use the .S thing in the places you're confused.

Attached: .S.png (1366x768, 86.68K)

gforth has support for local variables:
Gforth 0.7.3, Copyright (C) 1995-2008 Free Software Foundation, Inc.Gforth comes with ABSOLUTELY NO WARRANTY; for details type `license'Type `bye' to exit: foo { a b } a b + ; ok1 2 foo ok.S 3 ok

If you're not liking forth, you can also try Factor, which has locals and is more normal-y, python-y, still concatenative though:
Press F1 at any time for help.Factor 0.98 x86.64 (1888, heads/master-39cbe60fd2, Jul 16 2018 03:34:25)[GCC 5.2.1 20151010] on linuxIN: scratchpad USING: locals math ;1: Note:Already using ``math'' vocabularyIN: scratchpad :: foo ( a b -- n ) a b + ;IN: scratchpad 1 2 foo --- Data stack:3IN: scratchpad

Fuck you can even try kitten but it's purely functional (kittenlang.org/):
Welcome to Kitten! Type //help for help or //quit to quit 1: define foo (T, T -> T): -> a, b; a b (+) 2: 1 2 foo 3i32 3: define foo2 (T, T -> T): -> a, b; a + b3i32 4: 1 2 foo23i323i32

Factor's a completely different experience. Really gives lie to the notion that 'concatenative' is even a meaningful category of programming language.

Not really, concatenation is just a special case of functional programming, most importantly using a stack for data and treating code as data

That sounds... dangerous.

Said the smart pajeet, and called the support to recover from a backup because someone screwed up his website with SQL injection.

Tbh I don't see any reasonable use case for FORTH outside of the demoscene community.