snearch + forth   25

Forth: The Hacker’s Language (2017) | Hacker News
aidenn0 3 hours ago [-]

I don't use forth personally, but it is at a very interesting corner of the envelope.
I find it both easier to implement than C and easier to develop in than C, while being nearly as fast as C, and often lower footprint than C. It's a really good language for "I really don't want to write in assembly, but there are no decent HLLs already implemented for my target"

reply
fun_in_programming  Forth  Programming_Language 
6 weeks ago by snearch
Forth: The Other White Meat : programming
[–]pipocaQuemada 5 points 3 hours ago

To expand on this, point-free is a term that's borrowed from topology. Basically, point-free topology studies the subject without ever referring to underlying points, whereas point-set topology starts out by defining a topology as being a set of points and a set of neighborhoods for each point that satisfies some axioms.

Correspondingly, point-free programming is working with functions without talking about the underlying arguments. For example, given a pointful definition of a sum function

sum xs = foldl (+) 0 xs

we can take advantage of partial application to write the corresponding point-free definition:

sum = foldl (+) 0

Or, given something like

foo x = a
where y = bar x
z = baz y
a = quux z

we can give an equivalent pointfree definition:

foo = quux . baz . bar

Needless to say, pointfree style often makes simple examples clearer and complex examples incomprehensible: compare

bimap f g (a,b) = (f a, g b)

and

bimap = flip flip snd . (ap .) . flip flip fst . ((.) .) . flip . (((.) . (,)) .)

...

[–]antiquarian 2 points 4 hours ago

There's also factor, which is a modern language with a similar code structure to Forth. Factor has more data structures built in, with the ability to put blocks of code on the stack, and combinators that use those blocks.

permalink
save
parent
report
give gold
reply

about
blog
about
team
source code
advertise
jobs

help
wiki
FAQ
reddiquette
rules
contact us

tools
mobile
firefox extension
chrome extension
buttons
widget

<3
reddit gold
store
redditgifts
reddit AMA app
reddit.tv
radio reddit
...
[–]dlyund 4 points 7 hours ago*

It's something you have to get used to but, having already learned C and APL/J/K, I was already happy with arrays or structures, and have had no problem getting things done in Forth. I certainly wouldn't describe it as inadequate. I might even say that the lack of built-in data-structures is a feature, since it forces you to consider what data structures are appropriate for your problem. When programming in languages like Python and Ruby etc. everything seems to end up in a dynamic array or hash table, even when this isn't the right data structure [1].

In contrast Forth lays out memory like a canvas in front of you and lets you paint whatever you like on it.

Given that you can easily create appropriate data-structures.

You can knock together things like singly and doubly linked-lists, stacks, queues, trees, and tables, interactively in minutes, assuming that you understand the details of these things in advance, and give them each a concise syntax that makes sense in the context of your program.

[1] I really like Clojure and I agree with a lot of what Rich Hickey says but I find the belief that all data should be shoehorned into lists, vectors, sets, and hash-tables etc. very disconcerting. Sure, you can do it, but you shouldn't. Not only is this kind of shoehorning inherently suboptimal but it discourages finding the right data-structure, which as we know, often makes the difference between complicated and inefficient solutions and elegant and efficient solutions - the right data-structure does more to simplify the code than any amount of fancy abstraction.

permalink
save
parent
report
give gold
reply
Forth  Programming_Language  pointfree  Professional_Software_Development  Factor  higher_quality 
november 2014 by snearch
A Forth Story... - comp.lang.forth | Google Groups
I was to work with
the president and owner, Dr. Howard Marshall, Ph.D., on a project to
develop an instrument to measure the real-time sulphur content of a
coal stream by detecting and analysing the prompt gamma ray spectrum
resulting from the absorption of thermal neutrons from a Californium
252 radioactive source. The opportunity sounded exciting to my naive
ears, as it was my first professional job. I was finally in the real
work world of adults and ready to go on to do great things. Remember,
this was twenty years ago and I was only twenty-two years old. I had
no previous experience to guide me in the situation I was in, no
mentor to teach me, no helping hand and no idea of where to begin or
what to do. Like most good engineers, I decided to fake it until I
understood my value.
TOP  Inspiration  print  Maschinenbau  Profession  Occupation  Ingenieur  Forth 
april 2012 by snearch
blg - 2009 - 11 - 28 - 0 | Anarchy in the tubes
I have spent the last months discovering Forth: learning about it, reading about it, trying 4th, porting pForth to Plan9,... It is a language that I love, since I spent many hours programming my HP49G calculator and I always was a fan of the RPN syntax and simplicity in general.

My last discovery has been retroForth, a minimalistic Forth which runs on a portable virtual machine, Ngaro. When some days ago Google the Go-team presented their new language I was watching Rob's talk and could not stop thinking about launching Ngaro virtual machines in goroutines communicated through channels. So... that's what I did:
TOP  Inspiration  Forth  Ngaro  Virtual_Machines  Ngonga  retroForth  Golang 
december 2009 by snearch
Luke's Weblog - Cheating
So the USB2VGA dongle isn't much fun to program -- especially since I haven't found a spec for the SiS315 graphics chip. I started out by porting very tedious Linux code like this:

ret |= SETIREGAND(SISCR, 0x5b, 0xdf);
ret |= SETIREG(SISSR, 0x05, 0x86);
ret |= SETIREGOR(SISSR, 0x20, 0x01);

ret |= SETREG(SISMISCW, 0x67);

for (i = 0x06; i <= 0x1f; i++) {
ret |= SETIREG(SISSR, i, 0x00);
}
for (i = 0x21; i <= 0x27; i++) {
ret |= SETIREG(SISSR, i, 0x00);
}

and after a while I reached the important realisation that these hundreds of numbers that you need to send the dongle in order to boot it are completely boring.

There's no sense in filling up source files with boring numbers, so I changed strategy. I recorded what Linux sends over USB to make the dongle boot and checked whether I could just blindly replay exactly the same traffic. This turned out to be easy and fun!
USB  Inspiration  Forth  tcpdump  awk  Embedded_Systems  hack 
march 2009 by snearch
Forth Day Report - Samuel's All-New New News News Page
One of the things he discussed was his desire to build a printed circuit board with a matrix of 10x10 (yes, 100) SeaForth chips on it. This would produce a board with 2400 cores, or the processing equivalent of 4.32x10^13 instructions per second. Look at
Trends::Hardware  Forth  Parallelisierung 
november 2007 by snearch
StrongForth v1.2 - comp.lang.forth | Google Groups
Version 1.2 of StrongForth has just been uploaded to
http://home.vrweb.de/~stephan.becher/forth/. The major changes with respect
to the previous version (1.1) are:

a.. Added File-Access and Memory-Allocation word sets.
a.. Added 24 blocks of new sam
Forth 
april 2007 by snearch
Stack manipulations (about 100 lines) - comp.lang.forth | Google Groups
On a related note, some time ago I wrote a short Prolog program that
finds the shortest stack manipulation sequences for a given stack
effect. Or, alternatively, the shortest sequences equivalent to a
specific sequence.

E.g., to find sequences rever
Prolog  Forth 
april 2007 by snearch

Copy this bookmark:



description:


tags: