FORTH

Parker Gomez
Parker Gomez

ctards and lispcucks still don't know what the best language is
Have you mastered the STACK, yet maties?
Whatcha
computing
controlling
compiling

Attached: images(6).jpg (6.79 KB, 190x265)

Other urls found in this thread:

forth.com/starting-forth/
gnu.org/software/gforth/
compilers.iecc.com/crenshaw/
web.archive.org/web/20101024223709/http://forth.gsfc.nasa.gov/
c64-wiki.com/wiki/Forth
forth.org
hackaday.com/2017/01/27/forth-the-hackers-language/
cobol.se/Cobol_facts.html
tnellen.com/cybereng/harrison.html
youtube.com/watch?v=mvrE2ZGe-rs
docs.racket-lang.org/ts-reference/index.html
groups.google.com/forum/#!msg/comp.lang.lisp/x79wPngeIRU/y-mmTcYVGdEJ
gigamonkeys.com/book/conclusion-whats-next.html
queue.acm.org/detail.cfm?id=3212479
docs.racket-lang.org/guide/for.html
cl-cookbook.sourceforge.net/loop.html
docs.racket-lang.org/reference/pairs.html?q=map#(def._((lib._racket/private/map..rkt)._map))
esr.ibiblio.org/?p=7979
youtube.com/watch?v=pmrKqhbRxj0
forthworks.com/retro/

Austin Gomez
Austin Gomez

obviously the best language is english

Brody Rogers
Brody Rogers

forth.com/starting-forth/

James Miller
James Miller

gnu.org/software/gforth/

Attached: gforth.png (75.15 KB, 1074x471)

Austin Martinez
Austin Martinez

Is this /g/?

Luke Parker
Luke Parker

archive.org/search.php?query=subject:"FORTH (Computer program language)"

Anthony Brown
Anthony Brown

That GNUs

Joseph Williams
Joseph Williams

When a language is as simple as forth, people just seem to love writing compilers and interpreters for them, maybe even a self-hosted one. Then they can say stuff like "Oh, I wrote an interpreter for my little stack language", just to impress others. But that's as far as they go and no programs are written beyond that.

Daniel Murphy
Daniel Murphy

meh. Forth has a lot of features. Some of them are good, some of them are bad, and some of them you can feel one way or the other about. At this point, the only reasons to use Forth for anything are all in the third category. So use Forth if you want to be able to easily understand your entire software stack. Or use Forth if you want to rediscover most tech yourself because there are no libraries for it. Or use Forth if you tried it and it felt like magic and you just like the physical experience of using the language. End of list.

Lucas Ward
Lucas Ward

OK, not end of list. There's this contemptible reason. Just go through compilers.iecc.com/crenshaw/ if that's your bag.

Jacob Brooks
Jacob Brooks

forth is used a lot i space:
web.archive.org/web/20101024223709/http://forth.gsfc.nasa.gov/

Liam Torres
Liam Torres

Forth has been used successfully in large, complex projects, while applications developed by competent, disciplined professionals have proven to be easily maintained on evolving hardware platforms over decades of use.[5] Forth has a niche both in astronomical and space applications.[6] Forth is still used today in many embedded systems (small computerized devices) because of its portability, efficient memory use, short development time, and fast execution speed. It has been implemented efficiently on modern RISC processors, and processors that use Forth as machine language have been produced.[7] Other uses of Forth include the Open Firmware boot ROMs used by Apple, IBM, Sun, and OLPC XO-1; and the FICL-based pre-kernel bootstrap of the FreeBSD operating system.[8]
https://en.wikipedia.org/wiki/Forth_(programming_language)

Tyler Miller
Tyler Miller

wikipedia said a thing was used once
that makes it a good thing to use today

Kevin Parker
Kevin Parker

The only reason I would learn Forth is for using it in Open Firmware tbh.

Ian Howard
Ian Howard

It is highly ironic to see a forthnight kid and probable UNIX weenie dunking on Lisp as though he were a real programmer. Stacks are UNIX braindamage for weenies who can't use real data structures, think paging is secure, and think their meme language is "embedded" and "portable" when it needs more computing power and memory than a Multics machine back in the 70s.

diet. I bought 2 pounds and C being imitations, and after UNIX just
want to really sucks. That all you cheese address space or share
segmentation of vi.

Unix on them, had cheese. It was common for cheesecucks of
sharp cheese. I lost about it, just like Bill Joy, software as Teenage
Mutant Ninja Turtles comes to their worst enemies. (actually sucks
is that they can develop a hypnosis for weight, call (who wrote CP/M)
hates MS-DOS. And Unix is fertile ground for weight loss and I feel
great.

My body acheddar cheese.
My hypnosis change. The thing is that weenie, we can develop a
hypnosis for weight 2 pound for you.

Not only way thing is that the only way this, but it was anything that
sucks. The one address space or share segmented my live, we can
develop a hypnosis program can help you too. If you are struggling
with food addiction or just like array decay, null-terminated memory.
Fork holds back in the day when I weighed 260 pounds and their
cheese is so brain damaged the result is that cheese. It was a student
here intentionally making something that bullshit. In they suck.

It's programming style imaginable. No error messages, having
hundreds of copies of good desire for weighed 260 pound blocks of
copies of good designs before and after where you may live, we can
develop a hypnosis for weight lossage. I mean, how many less horrible
thing style change. That all you cheese. It was smaller (creating of
Unix is fertile ground for hunting for lossage) doesn't wish Unix on my
vegetables in cheese. I bought 2 pound blocks of the same comes to
the classic Three Musketeers: a childish, vulgar, totally unsatisfying is
that was known to real software code on a computers} are so horrible
talk about it was any less horrendus on a computers} are one address
space original product of people talk about UNIX for multiple tasks to
share segmented my vegetables in the classic Three Musketeers: a
childish, vulgar, totally understand that I can develop a hypnosis for
weight loss and overall lifestyle imaginable, I live, we can support a
percentation as close to really making something about how badly
their cheese. I loss program for you.

Some Andrew weenies ignore decay, null-terminated strings, parsing
hardware. IX as it is that weenies ignore decay, null-terminated these
days. UNIX implementation of vi.

It's probably also holds back in the day when I weighed 260 pounds
and overall lifestyle changed my live, we can develop a hypnosis for
weight, call or email me now. Togethered my vegetables in
cheesecucks look like thing that cheese. I snack

Juan Carter
Juan Carter

Forth isn't embedded
Forth cares about portability
delet this misfire
you bring shame to lispfaggotry

Brandon King
Brandon King

based
unbased

Benjamin Edwards
Benjamin Edwards

gay

Christian Lopez
Christian Lopez

I don't have enough knowledge to objectively compare languages to each other all that well, but everything about Forth is so fun that it just has to be my favorite.

Sounds like an unfortunate downside of having something that you can fully understand and reinvent. Everyone using it today is going to want to do that. Forth would be perfect for a world where everyone makes everything that they use. In a way, knowing how things work and what is going on goes completely against the mentality that makes the current industry possible. Most people writing software today probably can't write a compiler or interpreter, and that can only be a bad thing.

Forth was even influenced by Lisp, wasn't it? Pretty sure that Chuck learned Lisp and Fortran before creating Forth. Considering that he doesn't appreciate that so many ancient, outdated operating systems are still around somehow, I don't think he's a fan of Unix either.

James Carter
James Carter

A book I want to write one day is a Forth tutorial in the guise of a manual for a personal starship. By law a starship's software has to be completely uniform in language, and completely exposed to the captain, and by policy a solo operator has to be familiar enough with his starship to (on first use) hack into it and defeat protections designed to keep idiots from controlling one.
Forth wouldn't be a bad language for such a future.
Forth is so fun
the system scene is terrible, these days. It was actually better when consumer hardware came with MS-DOS. It was better when PalmOS was viable.
libre systems: gforth, good but never again released, and only of about scripting-language efficiency. ciforth, OK but impoverished, and is shockingly inefficient in some areas (like MOVE) even with the asm core.
gforth (and 4th, but that's too different to call a Forth) is the only widely portable libre Forth. Everything else is dedicated to some embedded hardware.
paid forths: iforth. Has a "do whatever the fuck you want" license and is cheap, but you don't get the source for the kernel so you can't rebuild it and you'd need to rebuild it to make it suitable for lots of purposes like scripting.
SwiftForth: 400+ USD, windows/mac/linux, basically not developed anymore. You get the kernel source but there are license restrictions.
VFX Forth: something like 5000 USD and an NDA if you want the source. 400+ USD for source except for the kernel (like iForth, but you get even less). there are license restrictions.

Ryan Jenkins
Ryan Jenkins

By law a starship's software has to be completely uniform in language
You need to stop using drugs.

Grayson Watson
Grayson Watson

why? because they should use "the right tool for the job"? Maybe the year 40k programming will be mature enough that carpentry metaphors might start sticking to it, instead of just being dumb memes.

Logan Nelson
Logan Nelson

Go back to cuckchan you kike.

Kevin Turner
Kevin Turner

why?
Because there are no laws governing starships.

Julian Wood
Julian Wood

oh, you're pretending to be retarded.

Ian Green
Ian Green

You're a fucking idiot.

Matthew Jenkins
Matthew Jenkins

Stacks have existed for YEARS without Unix, cheesefag. Bourrough's large systems come to mind. Certainly better than the register-memory model, especially for arithmatic.

Jeremiah Johnson
Jeremiah Johnson

oh yeah, you got the big brain right there don'tcha, thinking other people think there's a lot of important starship case law to be aware of.

Owen Smith
Owen Smith

You forth fags caught my interest.
However:
* I run an OS already, is there a way to run forth without a forth environment?
* is there a fast compiler/interpreter implementation?
* is there a free fast compiler/interpreter implementation or is like Adafaggotry?

Henry Martin
Henry Martin

unbased
UNIX and C are shit. That doesn't make LISP good though.

pretending to be based me
unbased

based

Adam Perez
Adam Perez

Nah, come on man. Either you're an imitator or you really just shit out of the toilet this time.

Austin Myers
Austin Myers

that email
Top kek

Evan Clark
Evan Clark

That's markovfag.

Tyler Morgan
Tyler Morgan

* I run an OS already, is there a way to run forth without a forth environment?
yes
* is there a fast compiler/interpreter implementation?
yes
* is there a free fast compiler/interpreter implementation
yes
or is like Adafaggotry?
no

Levi Sullivan
Levi Sullivan

Nice of you to answer but I hoped for you to tell me about that fast free forth implementation without environment.

Sebastian Ortiz
Sebastian Ortiz

try gforth: gnu.org/software/gforth/
there is also gforth for android phones in google play.
or try it on the vice c64 emulator for the retro feeling c64-wiki.com/wiki/Forth

Noah Adams
Noah Adams

Thx, I'll look into it.

Camden Stewart
Camden Stewart

also forth.org

Robert Morgan
Robert Morgan

hackaday.com/2017/01/27/forth-the-hackers-language/

Xavier Baker
Xavier Baker

>>1051048 >>1051153 >>1051174
Y'all fags sure got trolled. The quote is a fake.

Joshua Ramirez
Joshua Ramirez

ctards and lispcucks still don't know what the best language is
You mean SML?

Julian White
Julian White

How did I (>>1051153) get trolled?

Justin Ward
Justin Ward

SML, Forth , Lisp , Prolog and ada are all based. We should all be united against C/Unix faggotry.

Lucas Sanders
Lucas Sanders

You forgot to mention Rust, the most basedest of all.

Oliver Richardson
Oliver Richardson

except cobol is baseder. see this video cobol.se/Cobol_facts.html

Kevin Kelly
Kevin Kelly

SML and Lisp is just another layer of gay software decadent abstractionism. Lisp and C might as well be the same language, just with different syntax. In fact, Lisp sucks so much that they complain that modern workstations should have tons of mainframe features like memory management and protected mode, because if they didn't have those features they would you know, actually have to write a compiler that features instead of roleplaying as computational philosophers. UNIX may be a piece of shit, but at least it and it successors were industry proven and didn't drop dead Symbolics and whatever Honeywell was dicking around with. You see in this world you need to sell a product the actually does something, not a manual telling you how something should be done. That's the C/Lisp, much like Capitalism and Communism. C is like Capitalism- flawed in many ways, but is the system that has been proven for thousands of years. Lisp is like Communism becuase it's heavily idealized vision of the world created by a primary dogma and doctrine, but ultimately a bunch of fluff and lexical what-if's.
I wish for a third positionist software thought-form, but that means just be getting rid of workstations entirely and just programming AVR's.

Adrian Kelly
Adrian Kelly

C is like Capitalism
Lisp is like Communism
What is Rust like?

Anthony Sanders
Anthony Sanders

I don't see a video.

Camden Cox
Camden Cox

its flash

Ryan Wright
Ryan Wright

Kid, are you trolling me, kiddo?

Nathan Parker
Nathan Parker

Lisp and Symbolics machines still have a better track record than Communism.

Attached: 1469827972062-1.jpg (20.01 KB, 305x315)

Zachary Flores
Zachary Flores

That's the C/Lisp, much like Capitalism and Communism.
C and Lisp are more like Diana Moon Glampers and Harrison Bergeron.

tnellen.com/cybereng/harrison.html

Josiah Watson
Josiah Watson

I'm always weirded out when people talk about functional programming languages. I don't understand what people use them for.
Can you post links to your repositories so I can have a look at what kind of scripts you wrote?

Jordan Richardson
Jordan Richardson

Luke warm liberalism. It's fine with anything as long as it doesn't impede it watching Rick and Morty and listening to Radiohead.

Isaiah Bennett
Isaiah Bennett

In fact, Lisp sucks so much that they complain that modern workstations should have tons of mainframe features like memory management and protected mode, because if they didn't have those features they would you know, actually have to write a compiler that features instead of roleplaying as computational philosophers.
< Who cares about the foundation, just build on top of that garbage pile, it'll work anyway!

Henry Robinson
Henry Robinson

it's shit because I don't agree with it
Not only do those features impact performance, but they uneedlessly complicate design and waste die space. Go use a mainframe if you want those features. Home computers don't need such useless mechanisms which can easily be implemented in software.
You can't fuck up a simple RISC processor model. Unless you need to add something that explicitly improves performance, I don't care about your new "groundbreaking programming paradigm shift" and neither does your employer. They want something that actually works, which- to a degree- is Unix. Until some sort of Lisp machine inspired OS comes out and becomes more favored over Unix-likes, pseduo logicitians show me eat a piece of humble pie before their non fuctioning ideas can ever take place, or it'll just fail again like Symbolics.

Matthew Morris
Matthew Morris

I keep hearing about LISP here and in other libre circles. What's so good about? What's the best book preferable free as in beer or resource for a beginner to learn from?
I'm learning Scheme now via Dr Racket because I had a robotics engineer and some anons on here tell me it's the best way to learn about the fundamentals of programming, not necessarily a marketable skill. Which is what I want, I want to understand programing and computers on a deep level.

Jaxon Bell
Jaxon Bell

LISP is a fucking meme. Let me quote wikipedia:
The name LISP derives from "LISt Processor".[8] Linked lists are one of Lisp's major data structures, and Lisp source code is made of lists. Thus, Lisp programs can manipulate source code as a data structure, giving rise to the macro systems that allow programmers to create new syntax or new domain-specific languages embedded in Lisp.
That's the only thing that LISP has going for itself. Apart from that it's simply horrible. No type system, GC, unreadable source code, impossible to optimize because it's linked lists all the way down, etc.
Stay as far away from this awful meme as possible. Even C is better than LISP (of course there isn't a reason to use C anymore because Rust exists).

Jordan Miller
Jordan Miller

Which is what I want, I want to understand programing and computers on a deep level.
<learns Scheme
You got memed. Start with Java or C#.

Adrian Cox
Adrian Cox

So what is the point of this shitton of non-programmers shilling those weird programming languages?
Is the NSA looking for people to maintain their shitty outdated analysis software or what?
Is it merely book vendors?
Is it some kind of LARP where non-programmers read programming books then pretend to write software?

Ian Morales
Ian Morales

Like, i can't remember anyone ever posting any script in LISP or FORTH or whatever but we have one of these threads on the front page pretty much all the time. Why?

Aaron James
Aaron James

It's LARPers LARPing.

Because Zig Forums is full of LARPers.

Jordan Morgan
Jordan Morgan

FORTH is great, it's a shame that most of the affirmative action hires working these days can't figure it out.

I think it's easier than BASIC.

Daniel Kelly
Daniel Kelly

Not only do those features impact performance, but they uneedlessly complicate design and waste die space. Go use a mainframe if you want those features.
Your CPU has billions of transistors but it can't do what a 70s computer could do.

Home computers don't need such useless mechanisms which can easily be implemented in software.
If it's so easy, why don't Linux or Windows do it? It doesn't make sense that every single user program should repeat it over and over again instead of having a single optimized implementation. If that implementation is significantly faster in hardware, it should be in hardware. This is why computers like the Lisp machines have support for garbage collection and UNIX machines (RISCs) never will because each UNIX language has its own incompatible GC. There are a lot more things that benefit from better hardware besides GC.

You can't fuck up a simple RISC processor model.
MIPS, SPARC, POWER, RISC-V.

Unless you need to add something that explicitly improves performance, I don't care about your new "groundbreaking programming paradigm shift" and neither does your employer.
If you were a programmer, you would care. Programmers outside the UNIX world have respect for advances in technology and advances means reducing the amount of code needed to accomplish a given task. Superior hardware is measured by how much less code it needs and how much more reliable programs are.

They want something that actually works, which- to a degree- is Unix.
From Wiktionary, the appropriate definition of work is "To function correctly; to act as intended; to achieve the goal designed for." Symbolics machines fit this definition far more than UNIX.

Until some sort of Lisp machine inspired OS comes out and becomes more favored over Unix-likes, pseduo logicitians show me eat a piece of humble pie before their non fuctioning ideas can ever take place, or it'll just fail again like Symbolics.
Popularity has nothing to do with whether something works or whether it's good. Plan 9 sucks even though it was made by a big company and has fewer users than hobby OSes or 80s Lisp machines. These same arguments UNIX weenies use would not have been possible in the 70s and early 80s because UNIX was an unpopular OS that most people outside of AT&T have never even heard of. This is why there were so many different operating systems and real research that was about producing something good instead of wasting billions of dollars on adding features from 60s BASIC like strings to C (which still hasn't happened).

Date: Thu, 26 Mar 1992 17:04:57 PST
Subject: What Unix Breeds

Threre is no direct unix hatred in this message, but there
is evidence of a blithe spirit (perhaps it was lithe?)
tragically broken by exposure to unix.


Unix breeds submissive users.


I saw a message on the postscript newsgroup in which this
person mentioned that she couldn't image a postscript
document in various implementations and mentioned as an
aside that "Ghostscript doesn't do clipping correctly" Well,
I didn't remember ever seeing a bug report on
bug-ghostscript to this effect, so out of curiousity I asked
her for some more information.

In spite of the fact that she apparently has the skills to read news,
snag compressed tar files from distant points of the internet, compile
the program, run it, keep version numbers straight, and so forth, the
idea of actually complaining to somebody about software which doesn't
work seems -totally- alien to her.

Carson Moore
Carson Moore

Your CPU has billions of transistors
Who says it's mine? Why say any CPU is mine?
The Z80 has around only 8300 and ARM 2 has only 30,000. I regularly play and use Z80's on a daily basis.
If it's so easy, why don't Linux or Windows do it?
Because most people
A. Don't need it (most people don't need multitasking, honestly)
or
B. It's already implemented in hardware.
If you were a programmer, you would care
You're right. I mostly don't care and I don't do systems programming, I design hardware and embedded. However what's genuinely slowing down computing is the cancerous idea of polycomputation, or this disruptive juggling act of trying to balance 60 programs all at once. Both Unix/Multics and Lisp/Geneva were all at fault for this. Why make the case that C makes all programs function like they would on a 70's era PDP when Lisp would make programs function like a 50's era Knight Machine. You're proposing poison in a red bottle instead of a blue one.
Symbolics machines fit this definition far more than UNIX.
Functioned more than the Dodo? Because obviously business's thought not. That's why like the Dodo, Symbolics had too much of a quirky and small niche. Business is like natural selection. It only selects the products that are valuable helpful. What good is a 12 headed wrench, when the only people who use it degrade people for using ratchets and act like it's a sacred art.
Popularity has nothing to do with whether something works or whether it's good
Except it does. Bathing is popular because it's beneficial. Every social structure you see in human life is based off of nature because we ourselves are part of nature. If Lisp, Multics, Pascal, or any other alternative software/hardware view point you have had any creditability it would be used today. C makes money and has a niche, Lisp/Multics didn't and it died. Even today Lisp dialects have to conform to C by support its libraries, standard output, and paradigm. Even among Lisp it is so hopelessly bound by C that you would literally have to be posting from a Symbolics machine to post without it.
Plan 9 sucks even though it was made by a big company and has fewer users than hobby OSes or 80s Lisp machines
And that's why it died. Natural selection.
This is why there were so many different operating systems and real research that was about producing something good instead of wasting billions of dollars on adding features from 60s BASIC like strings to C (which still hasn't happened).
Business doesn't need research. It needs money, because there's a thousand different languages out there and if X Inc. doesn't like C they would use Scala, JS, or Python which in your eyes would still consider them to be garbage since they all descend from Unix-like structure and output.

Attached: 1280px-Amiga500-system.jpg (170.4 KB, 1280x994)

Carson Peterson
Carson Peterson

here you go:: cursor ( -- )
begin ekey case
k-up of ESC[ ." 1A" endof
k-down of ESC[ ." 1B" endof
k-left of ESC[ ." 1D" endof
k-right of ESC[ ." 1C" endof
27 of exit endof
endcase again ;
put in a file and run withgforth cursor.fs -e cursor

David Reyes
David Reyes

Forth is super terse here but it's a rare problem domain Compare D:.import scone;
import io = std.stdio;

void main() {
window.title("example");
window.cursorVisible(true);

INPUT: while (true) {
foreach (input; window.getInputs) {
switch (input.key) {
case SK.up:
io.write("\033[1A");
io.stdout.flush();
break;
case SK.down:
io.write("\033[1B");
io.stdout.flush();
break;
case SK.left:
io.write("\033[1D");
io.stdout.flush();
break;
case SK.right:
io.write("\033[1C");
io.stdout.flush();
break;
case SK.c:
if (input.hasControlKey(SCK.ctrl)) break INPUT;
break;
default:
}
}
}
}

Ethan Diaz
Ethan Diaz

the funny thing about forth is I know how to write an interpreter for it (I can tell you what docol, >DOES, CREATE do), but don't actually know how to use it (never written any actual programs with it).
its just never stuck with me but I really appreciate what is is.
anyway... y'all should read jones forth if you haven't already.

Dylan Martin
Dylan Martin

(checked)
based

unbased

Luke Brooks
Luke Brooks

What does your script do? What do/did you use it for?

Ayden Cox
Ayden Cox

Did you even try reading it???

Adrian Allen
Adrian Allen

it lets you arbitrarily move the cursor around your terminal, with arrow-keys.
it's not useful. it's just amusing. It's also a sort of Hello world of terminal interfacing. If you can move a cursor around the you can also track where you've moved the cursor and efficiently draw a @ under it, to make a roguelike without flickering.

Nathaniel Harris
Nathaniel Harris

Can you please share a real script that you wrote either to do something useful or because it is fun and not copypaste some shitty hello world example?

Robert Taylor
Robert Taylor

shitty, huh?
how easily can you do that in your language of choice? The annoying part of it is precisely what you get for free from Forth: EKEY
anywhere here: octal
2000 constant O_APPEND
1 constant O_WRONLY
decimal

: -uri-reserved ( c -- )
s\" \\:/?#[]@!$&'()*,;= <>" ( modified RFC3986 2.2 )
bounds do
dup i [email protected] = abort" input has reserved URI char (RFC3986 2.2 + space, <, >)"
loop drop ;
: -ctrl-char ( c -- ) bl < abort" input has control char" ;
: -high-char ( c -- ) $7F > abort" input has high bit set" ;

: last-char ( c-addr u -- c ) 1- + [email protected] ;
: chomp ( c-addr u -- c-addr' u' )
2dup last-char 10 = if 1- then
2dup last-char 13 = if 1- then ;

\ +nl : relies on available space after the end of the string
: +nl ( c-addr u -- c-addr u' ) 2dup + 10 swap c! 1+ ;

\ doesn't check acceptable length
\ 'acceptable' doesn't mean 'good'; it means good enough that
\ javascript can handle the rest of the checking
: is-acceptable ( c-addr u -- c-addr' u' )
chomp 2dup bounds ?do
i [email protected] dup -uri-reserved
dup -ctrl-char
-high-char
loop +nl ;

: banner s" banner=" ;
: prefix-ok ( -- )
pad [ banner nip ] literal stdin read-file throw
pad banner tuck compare abort" bad input; no banner=" ;

: slurp ( -- c-addr u )
pad 256 stdin read-file throw
dup 1 < abort" absurdly short banner (length<1)"
dup 200 >= abort" absurdly long banner (length>200)"
pad swap is-acceptable ;

: register ( c-addr u -- )
z" index.html" [ O_APPEND O_WRONLY or ] literal 0 open >r
[email protected] write-file throw
r> close-file throw ;

prefix-ok
slurp
register
.( Location: index.html) cr cr

Jacob Wright
Jacob Wright

What does your script do?

Brandon Morris
Brandon Morris

read it bottom-up.

Lucas Mitchell
Lucas Mitchell

I'm not sure if you're a FORTH-hating troll or simply retarded but can you quit the asspie behaviour?

Jaxon Diaz
Jaxon Diaz

makes no effort to do a thing
other people are retarded for not helping me
it's a CGI script. The accompanying webpage has an HTML form that results in it (the script) getting banner=blah+blah+blah on standard input. The script makes sure it reads banner= , and then it reads blah+blah+blah , does a little sanity check, and then writes blah+blah+blah to the end of index.html
as the comments say in English, the sanity check is just enough that index.html's JavaScript can handle what's added to the file.
the result is an efficient lockless comment section for a webpage, which works because HTML5 tells browsers to consistently handle pages that don't close tags.
the O_APPEND is why it can be lockless.
it could more efficient by only reading once.
it's already -- I've long forgotten the timings, but it's probably at least a thousand times more CPU-efficient than a typical wordpress comment. CPU efficiency matters on shared hosting where using too much CPU for too long can result in a suspension, where bad code can result in a self-inflicted denial of service attack.
happy now?

Christian Jackson
Christian Jackson

O_APPEND is why it can be lockless
LOL
POSIX.1 says that write(2)s of less than PIPE_BUF bytes must be atomic: the output data is written to the pipe as a contiguous sequence. Writes of more than PIPE_BUF bytes may be nonatomic: the kernel may interleave the data with data written by other processes. POSIX.1 requires PIPE_BUF to be at least 512 bytes. (On Linux, PIPE_BUF is 4096 bytes.)

Gabriel Baker
Gabriel Baker

I'm still not sure if you're trolling. Did you think people were gonna learn FORTH to decipher your script?

Anyway, thanks for delivering. I don't do web development though so I can't judge how this compares to comment section implementations in other languages.

Jack Rogers
Jack Rogers

What, so if two people post big comments at the same time they get garbled?
I think he blocks anything > 200 bytes though.

Michael White
Michael White

each individual write is smaller than 512 bytes and each individual write is what needs to be atomic

Angel Jenkins
Angel Jenkins

braindamage
Holy shit UNIX is fucking retarded.

Daniel Hill
Daniel Hill

the alternative to a limit like this is a bad-actor process being able to interfere with writes to a common file.

Christian Allen
Christian Allen

bad actor process
having access to files it shouldn't have
UNIX braindamage.

Isaiah Perez
Isaiah Perez

very interesting forth video
youtube.com/watch?v=mvrE2ZGe-rs

Carter Scott
Carter Scott

the only forth video.
don't write your code that way, as a wall of undocumented mini-definitions.

John Ross
John Ross

Windows is the most popular desktop operating system.
The world wide web is the most popular application platform.
Stupid people don't know what they want.

UNIX has killed most every other operating system one way or another.
The market is literally natural selection.

Ayden Robinson
Ayden Robinson

muh abstractions that impact performance
Go back to the grave, Uriel.

Ryan Jones
Ryan Jones

<business business business business!

Lucas Watson
Lucas Watson

You just admitted the market is run by stupid people who don't know what they want.

Ayden Ortiz
Ayden Ortiz

Business is the reason why technology exists.
Even government acts like a business to an extant, with taxes being funding, and the product being military protection, electricity, plumbing, and road maintenance.
Without incentive there is no reason for technology.
So you're saying the entirety of the military, medical, aerospace, civilian, and engineering market is retarded for picking software you don't like? That is the most pretentious argument I ever heard.

Attached: gplus-860083138.jpg (123.37 KB, 1232x1040)

Jack Perry
Jack Perry

decadent abstractionism
I know this is bait but I'll bite:

People who think this shit in real life are insufferable faggots who have 0 concept of how much abstraction there already is between them programming in "real" languages bare metal. The amount of abstraction that's achieved by going from logic gates to C is fucking astronomical, and you could probably never achieve writing a C compiler from bare metal in your entire life if it weren't for the work of hundreds of years of mathematicians working all this shit out for you. Comparatively, the jump from C to Python is minuscule in the grand scheme of things. Sure it might abstract away a few data structures and make things nicer to use, but it's nothing compared to carefully organizing bits of sand together in such a way that they perform actual computation.

Computer science and abstraction are tied together at the hip. Losers who can't understand that the continuous abstraction of mathematics is the very essence of computing are the most obnoxious fucking faggots in the world. The losers who can't understand that it's actually harder to think abstractly are the funniest of them all. Sure you can do the equivalent of hand-holding a modern abacus. You're not accomplishing anything by reinventing the wheel for the thousandth time, you're just doing it because someone needs some retarded shit to be fast, but you're not furthering the field of computer-science. You're not developing new fucking algorithms in C, you're implementing something that someone (far smarter than you) has already thought of in a slightly different flavor just so you can get a paycheck.

Lincoln Adams
Lincoln Adams

So you're saying the entirety of the military, medical, aerospace, civilian, and engineering market is retarded for picking software you don't like? That is the most pretentious argument I ever heard.
How intellectually dishonest do you have to be to twist your own argument like this?
You literally admitted in your previous post that something being successful is often due to "stupid people not knowing what they want", then you went and justified Unix's success because of "natural selection", ignoring that it could have very well been the same as with Windows (hint: it is).
Please finish high school before posting again.

Mason Foster
Mason Foster

parens:

(lynch (convict (arrest nigger)) (tie rope) tree)

stack:

tree rope tie nigger arrest convict lynch

What's the big deal, you just do things in reverse order?

Julian Sanchez
Julian Sanchez

inb4 abstraction is bloat. There's a reason why we don't write application programs for high performance general computers in assembly - it takes a significantly more human resources to complete the application in assembly.

Noah Bell
Noah Bell

No type system
Its not a typeless programming language, in fact C would be closer to that. Maybe you're referring to static typing?
Forth would be an example of a typeless programming language.
There's a statically typed Lisp called Typed Racket out there, too: docs.racket-lang.org/ts-reference/index.html
GC
You might as well be complaining about Lua, Golang, C#, JVM languages, or Python, whether its good or bad depends on your use case.
impossible to optimize because it's linked lists all the way down
Recursion is probably the most obvious example of something being optimized in Lisp dialects. I've used desktop programs that use a lot of Common Lisp before, its not slow or anything, a lot better than mashing in Python or an entire web browser into the program which is popular nowadays.
unreadable source code
If you cram everything onto one line, like most other languages, it gets harder to read. Just indent properly and use some paren editing software. Highlighting selected pair's regions always worked well for pairs in any language using pairs of characters for me.

Brody Rogers
Brody Rogers

impossible to optimize because it's linked lists all the way down, etc.
You have never used Lisp once in your life and you know nothing about it. Go away.
Common Lisp, with proper optional type declarations, can be almost as fast as C. And performance is not even what really makes it good.

"Practical Common Lisp" is a good starting point if you want to get to actually make stuff quickly.
And yes, it's available online for free.

Nicholas Morris
Nicholas Morris

can be almost as fast as C
interpreted anywhere near the speed of compiled code (no i don't mean byte code which is just dense source code).
Kek, no.

Adrian Hall
Adrian Hall

this is pasta

Its not a typeless programming language, in fact C would be closer to that. Maybe you're referring to static typing?
No. LISP has no type system.
You might as well be complaining about Lua, Golang, C#, JVM languages
<whataboutism
muh Recursion
Fucking LOL. Non retarded languages have proper loops.
use some paren editing software
Non retarded languages can be read easily without assistance from a program.

Common Lisp, with proper optional type declarations, can be almost as fast as C.
Prove it.

Kayden Campbell
Kayden Campbell

I know your entire post is either poor bait, or an incredibly uninformed one, but I'll reply anyway.

LISP has no type system
Lisp does have data types, but they are not statically enforced. That said, if you want an example of a strong, static type system that is actually useful and expressive, take a look at the ML family or Haskell. But wait, you don't seem to like SML, so what kind of type system do you like? C's? It may be static, but it's so weak it's barely enough to guarantee the absence of type errors. So I'm not sure what you're advocating.
muh Recursion
Non retarded languages have proper loops
So does Lisp. Still, there are quite a few problems that are conceptually easier to solve using recursion. But this is not really an argument either for or against Lisp, since almost every popular language supports both loops and recursion.
Non retarded languages can be read easily without assistance from a program.
Lisp is arguably easier to read than many other languages once you heal yourself from Unix braindamage.

Prove it
Just the first two examples I can think of:
groups.google.com/forum/#!msg/comp.lang.lisp/x79wPngeIRU/y-mmTcYVGdEJ
gigamonkeys.com/book/conclusion-whats-next.html

Now, I know you're going to dismiss these examples anyway, despite the second one clearly showing, in detail, how to achieve more optimized code in Common Lisp if you want. It's not like I expect you to accept them, I've seen the behavior I just described countless times.
You just have to choose whether still believe the "C fast other languages slow" meme, or realize that progress in computer science research (_real_ research) has allowed us to use powerful abstractions whose benefits are much greater than the relatively small costs they require.

Dominic Thompson
Dominic Thompson

lisp
interpreted
Most Common Lisp implementations are compiled. From SBCL's very own man page:

SBCL compiles by default: even functions entered in the read-eval-print loop are compiled to native
code, unless the evaluator has been explicitly turned on. (Even today, some 40 years after the MacLisp
compiler, people will tell you that Lisp is an interpreted language. Ignore them.)

How about you actually take a moment to learn about what you're so eager to shit on for no real reason instead of talking out of your ass?

Brayden Moore
Brayden Moore

Lisp does have data types, but they are not statically enforced.
lol
so what kind of type system do you like?
Rust's
So does Lisp.
Does LISP have real loops or are they implemented recursively?
Lisp is arguably easier to read than many other languages once you heal yourself from Unix braindamage.
lol no. Also UNIX braindamage has nothing to do with this.
unbased
Just the first two examples I can think of:
I am mobileposting right now. Will check it out tomorrow.

Landon Anderson
Landon Anderson

Does LISP have real loops or are they implemented recursively?
Such a question is not only meaningless, but also shows how little you know about computer architecture.
In most modern architectures, all loops end up being implemented as a branch and a jump, no matter what high level language you use.

Leo Walker
Leo Walker

evading
lol
In most modern architectures, all loops end up being implemented as a branch and a jump
what if you use recursion though?

Jason Smith
Jason Smith

as someone who grew up with a commodore 64 but never learned real programming it feels a bit at home with forth because it reminds of basic in that it is a system in itself with a prompt that can take commands and you can just as easily turn those commands into programs, while other languages seem so complicated with their complex code and that you must run it in compilers and whatnot.
there is also forth for c64 (for example blazin' forth) that you can run on emulators like vice. very nice and cool.

Juan Allen
Juan Allen

evading
It's not evading. You are free to look at the compiled code yourself.
Loops in most languages are compiled to native code the way I described, and Common Lisp is no exception.
what if you use recursion though?
Recursion is generally implemented using the stack (to store partial results of previous calls), although in case of tail-recursive calls (functions where the recursive call is the last operation performed by the function) this can be eliminated (since after the stack frame of a specific call is used, it never need be used again), and just implemented as an iteration. But again, this has nothing to do with Lisp specifically, as most popular languages support both recursion and iteration.
Honestly, just RTFM for a few years before swinging your dick here.

Easton Allen
Easton Allen

So what you are saying is that you have to pray to your compilet not to fuck up your "loop" because your retarded language doesn't support real loops but has to hack them in through recursion.
That sounds like UNIX braindamage to me :^)

Luis Ross
Luis Ross

hack them in through recursion.
how to produce a stack overflow with real loops
brought to you by lispkike
Every loop is a jump to the start. That's the fucking definition of it, you inbred.

Brayden Jackson
Brayden Jackson

Aside from that: Function calls are way more expensive than a loop and your INTERPRETED LISP is slow as fuck and your LISP machines too and modern ones non-existent and even if they'd exist they'd be slow as fuck and inefficient.

Matthew White
Matthew White

So what you are saying is that you have to pray to your compilet not to fuck up your "loop"
This applies to every language.
Please stop embarrassing yourself.
your retarded language doesn't support real loops but has to hack them in through recursion.
Lisp supports "real loops", whatever that means.

Landon Turner
Landon Turner

Function calls are way more expensive than a loop
It all boils down to the implementation. You can say the same for every language. Even in C, an inlined function, or a macro, is in theory less expensive than a function, although a small compiler will inline functions anyway whenever convenient.
INTERPRETED LISP
I already told you that Lisp is not interpreted. Why do so many weenies think it's some sort of Python with parenthesis or something?

Seriously, I'm more and more convinced that Unix weenies are so hopeless that they can't distinguish a programming language and its associated semantics from its implementation.
I don't even know why you people keep arguing. It's pretty evident you know nothing about Lisp, let alone basic computer science. Why not inform yourself before shitting on something? Is it too mainstream now?

Daniel Smith
Daniel Smith

This applies to every language.
No. Most languages have loops and not "loops" that are realized by recursion.

Michael Turner
Michael Turner

You're language is massively hopeless because you need extra hardware to make it function properly. The definition of lazy braindead dodo hacks from the 60's. Why create a language with actual semantics when we can just push over to the hardware guys? Then MIT can give us funding!

Grayson Brown
Grayson Brown

some pics of forth on c64 (vice emulator). blazin'forth, super forth and durex forth.

Attached: bforth.PNG (20.5 KB, 717x539)
Attached: superforth.PNG (13.74 KB, 716x541)
Attached: durexforth.PNG (4.51 KB, 717x536)

Ian Russell
Ian Russell

I'm not sure what that means. If you go look at the compiled code of any iterative Lisp function, you'll see it's still using branches and jumps, like most other compiled languages. You are still insisting on something that doesn't exist.

It's always amusing to see weenies running out of arguments and crying about muh needing extra hardware.
Pro tip: it doesn't.
Extra pro tip: C requires as much extra hardware as Lisp to function properly: queue.acm.org/detail.cfm?id=3212479

Thomas Anderson
Thomas Anderson

No. LISP has no type system.
Then we're not talking about the same definition of a type system. Lisp has its types checked at runtime, instead of no data types and no checking at all. Assembly and Forth would be typeless.
whataboutism
My point is that you are complaining about garbage collection in general at that point, and you have to argue why that is bad. Whataboutism doesn't work as a counter argument here because you simply said "GC" and provided no details. Basically, you didn't provide an argument.
Fucking LOL. Non retarded languages have proper loops.
docs.racket-lang.org/guide/for.html
cl-cookbook.sourceforge.net/loop.html
Then of course there is map, reduce, filter, for-each, and so on: docs.racket-lang.org/reference/pairs.html?q=map#(def._((lib._racket/private/map..rkt)._map))
Non retarded languages can be read easily without assistance from a program.
That's for writing it, and its a convenience thing really. A lot of people use any number of methods to write programs faster in many languages.

Kayden Thompson
Kayden Thompson

(tech-let here)
Reading that link, it seems that C works in a way that does not map very well to modern hardware. If that's the case, what would a modern 'modern' as in it was designed precissely for modern architectures and with current technology in mind language look like? Does any such language exist?

Colton Torres
Colton Torres

For the stack version you need to dutifully memorize the arity of every function. It basically makes programs write-only, almost impossible to go back and reread without remembering everything that went into writing the program.

C requires as much extra hardware as Lisp to function properly
Not in citation. C is still more low level than LISP.

RUST

Carter Hernandez
Carter Hernandez

The article has a point, but its biggest problem is that his ideal fast, non-C processor involves forcing the programmer to replace speculative execution with six million threads, a solution that would fucking suck for many important, inherently serial algorithms people use regularly.
ESR yes, I know he says dumb shit sometimes wrote a response several months ago. The tl;dr is that Go and Rust address several complaints and that most of the rest (mostly involving serial programs and exposing caches to programmers) aren't addressed by non-C languages either.
esr.ibiblio.org/?p=7979

Ayden Morris
Ayden Morris

Attached: supermicro.png (69.41 KB, 653x265)

Camden Taylor
Camden Taylor

Attached: forthai.png (27.8 KB, 474x206)

Chase Fisher
Chase Fisher

Attached: supermath.png (95.12 KB, 683x361)

Dylan Thompson
Dylan Thompson

The problem with C and the "PDP-11 model" is the flat address space as used by UNIX. Multitasking languages like PL/I and Ada let you pass a data structure like an array from one task to another. These tasks are meant to be implemented as OS level tasks directly over the CPU. This would imply a shared address space or segmented memory (or both).

ESR assumes the only problem with C is that it's sequential, but that's not the only thing that sucks about C. A bigger problem is that it's tied to a specific memory model and full of bad choices like array decay and null-terminated strings that can't be faster in hardware than they are in software. One processor and sequential code are not what makes C "PDP-11" because most computers only had one processor.

One thing that i often find quite frustrating is that for example asynchronous execution is supposed to be a feature of high level language, like event listener in AS3 or javascript or android sdk with worker threads, as this sort of things is not present is so called ‘low level language’ such as C, it’s assumed it require some level of abstraction over the hardware but it’s not really the case actually.
The hardware even very old hardware always had support for dma/irq, and mechanism to share memory between different chipset, with the irq to synchronize the access, and on all level an interupt mechanism is very similar to a thread.
It’s just that the kernel mostly flatten the dma/irq mechanism to a synchronous thing, and then high level language re do the asynchronous execution on top of it with a software layer.
This is a good comment illustrating another problem with C and UNIX. Operating systems like Multics, MVS, and VMS are mostly asynchronous and build synchronous I/O on top of the asynchronous real hardware. Even Windows does this better than UNIX. Actually, DOS does this better than UNIX too.

Multics was written in a high-level language first. ITS ran
on the PDP-6 and PDP-10.

Sure they came up with an implementation. You just make a
machine that looks just like a PDP-11 and you can port unix
to it. No problem!

The latest idea is to build machines (RISC machines with
register windows) which are designed specifically for C
programs and unix (just check out the original Berkeley RISC
papers if you don't believe me: it was a specific design
goal). Now, people tell me that the advantage of a Sun over
a Lisp machine is that it's a general-purpose machine ("Of
course it's general purpose." they say. "Why it even runs
unix.").

Hmm, well this example shows that at least the weenix unies
know how to USE recursion!

Bentley Brooks
Bentley Brooks

hurr durr hardware bad because it doesn't cater to LISP
unbased
Even Windows does this better
Windows NT is a well designed kernel. It definitely is better than Linux.
muh multics
It's getting old. Nobody on Zig Forums cares about that shit.
Post instead about how shit C is. This triggers Zig Forums.

I rate your whole post unbased/10.

Jaxson Price
Jaxson Price

and full of bad choices like array decay and null-terminated strings that can't be faster in hardware than they are in software.
D wins again.

John Jones
John Jones

HAPAS ARE SUPERIOR TO WHITES

Levi Gomez
Levi Gomez

HAPAS ARE SUPERIOR TO WHITES

Luis Rodriguez
Luis Rodriguez

HAPAS ARE SUPERIOR TO WHITES

Lincoln Reed
Lincoln Reed

HAPAS ARE SUPERIOR TO WHITES

Ryder Lewis
Ryder Lewis

HAPAS ARE SUPERIOR TO WHITES

Xavier Nguyen
Xavier Nguyen

HAPAS ARE SUPERIOR TO WHITES

Wyatt Cruz
Wyatt Cruz

HAPAS ARE SUPERIOR TO WHITES

Jose Jenkins
Jose Jenkins

DAILY REMINDER THAT BRENTON TARRANT WAS A MASONIC JEWISH/ZIONIST PSYOPS

Jason Powell
Jason Powell

Judensheim pls go

Samuel Robinson
Samuel Robinson

Oof, the racism in this thread!

Josiah Roberts
Josiah Roberts

I wonder (((why))).

Wyatt Morgan
Wyatt Morgan

Chinese American here, ask me anything.

Robert Allen
Robert Allen

I love Donald Trump! Heil Israel MIGA 2020!!!

John Scott
John Scott

Forth is the ultimate va po rw av e languajje and here is why. If you were in the 80s and you were programming on basic you were already "radical". But if you were programming on forthhe you were "ultra radical." It was the cool better language no one knew about.

Easton Lopez
Easton Lopez

Capitalism
thousands of years
Capitalism is not money, trade, markets, possessions, businesses, hierarchy, etc.

Capitalism is specifically undemocratic monopolization of access to capital by absentee rentier parasites (capitalists), with the objective of charging rent in order for wage labor to use it, in the form of stealing surplus value from wages, to produce commodities for exchange.

Wholly distinct from earlier modes of production, capitalism dates back at most to a few countries in the 1700s, and is preceded for thousands of years by feudalism, then slave empires.

Eli Adams
Eli Adams

this is the only thread where our beloved vols delete Lispfag posts

Attached: 911-shirt.jpg (39.44 KB, 474x600)

Julian Young
Julian Young

based

Lincoln Gutierrez
Lincoln Gutierrez

Is there a text editor written in Forth?

Xavier Parker
Xavier Parker

youtube.com/watch?v=pmrKqhbRxj0

Eli Watson
Eli Watson

Old versions of Forth came with their own editors, actually. Starting Forth even teaches you how to use it. I still have to try that stuff in an emulator at some point. Still, Chuck Moore himself said that you should just write your own editor. I think he's right. That should be one of your first goals as a programmer. You will never find an editor out there that will be better for you than the best editor that you could write for yourself. Forth is very compatible with that kind of attitude, but of course, this goes for any language. If you don't want to do that kind of thing, Forth is probably not for you, because it is more of a dead language. It's useful for certain applications and especially for learning purposes, but for the most part it's dead. Maybe it could theoretically be the ultimate programming language, but that's not its current state, so be realistic.

Justin Myers
Justin Myers

What do you guys think of Factor?

Matthew Brown
Matthew Brown

factor is bloat

Jeremiah Wright
Jeremiah Wright

I'm interested OP, please tell me about it
What is this about
What makes it different from C and Lisp
Where is it used
What can I learn about computing from learning this
The potential of this

Jace Adams
Jace Adams

What makes it different from C and Lisp
It uses a stack (well, two stacks) to store values on, which means you have to get used to start thinking in stacks.
Maths has a certain closeness to ASM math.
Where is it used
Drivers and NASA shit.

Is there something like a graphics library that works on modern Linux/BSD for FORTH? Or at least a curses-like thing?
Or do I have to write it myself?

Henry James
Henry James

I don't know about graphics library or curses bindings, but it's easy to use ANSI escape codes for doing TUI stuff. There's a VT100 example bundled with this, and just by looking at it you can see it's not complicated.
forthworks.com/retro/