Fork me on GitHub
#off-topic
<
2018-12-17
>
todo13:12:30

Anyone have a good recommendation for a list of exercises for mastering forth? I know of the books Thinking Forth / Starting Forth, but I feel like I have not yet run into an application where Forth just beats everything else.

pablore16:12:43

I have this coming and going idea of making a forth compiler for the DMG-01 Nintendo GameBoy

mseddon23:12:07

It's worth looking at some of chuck's writing on colorforth too. Forth... really doesn't beat anything else, but it gives you a satisfying feeling when you get it. 😉

mseddon23:12:57

it was incredibly useful in the era of memory constrained and potentially massively binary incompatible systems. Since he was exposed to Lisp as an asm hacker, there are some (random) similarities.

mseddon23:12:31

There was a book I completely forgot from the 80's that built an OOP system in FIGFORTH with classes and inheritance etc, which gave a good impression of forth defining words (lisp macros) which was very good, though I forget the title, sorry. Definitely scour the Forth literature around the 80's microcomputer revolution though, since the exhilaration was quite palpable at the time 😉

mseddon23:12:05

(but look at it through the sober lense of 2018, naturally ;))

valtteri13:12:43

This has been on my todo-list for a while https://moonforth.github.io/

todo13:12:46

Minecraft has a CPU forma, DCPU-16, and this guide targets that arch ?

todo13:12:56

[Just double checking, as it's so unexpected.]

valtteri13:12:38

> Ever wanted to learn how the system on the Philae comet lander works, ported to an imaginary vintage computer used to control a spaceship in a futuristic game by the creator of Minecraft? > The DCPU-16 was created by Markus “Notch” Persson in 2012 for the game 0x10c. Notch, having been responsible for Minecraft (one of the best selling and most widely known computer games of all time), had a fanatical following when 0x10c was announced. Since 0x10c was to be a successor to Minecraft, and since it concentrated on vintage computing with a 16-bit CPU, programmers descended upon it in droves and wrote their own emulators, assemblers, even entire operating systems, for the architecture before the game was even released.

todo13:12:00

I completeyl misread that. Thanks for clarifying. 🙂

👍 1
Conor13:12:38

If you want to program an imaginary computer, play TIS-100 instead

todo13:12:40

Actually, I just want to master Forth. Though, in 2018, outside of embedded systems, it might as well as be an imaginary computer.

Richard Smedley13:12:14

There was a nice little board with Forth on launched in 2011, with a rather neat Lunar Lander program. Looks like it's still available: https://sites.google.com/site/libby8dev/fignition

todo13:12:12

Are most Forth impls: VM + indirect threaded code based ?

mseddon23:12:35

Threaded code was a big 80's thing when it was a benefit to store an instruction in 16-bits. 'modern' forths emit assembly basically using , and C,. Chuck himself was somewhat against complex register allocation and compilation last time I talked to him in the early 2000's, mostly because he saw Forth as 'simple and small'.

mseddon23:12:05

The DPANS implementing commercial forths completely ignored his position, of course

mseddon23:12:14

There is a fantastic book from the 80's called "Threaded Interpreted Languages" that is well worth the read if you know or are interested in the Z80. Designed very much for 16k systems, where an assembling compiler would have been pretty tight.

cvic15:12:54

https://github.com/benzap/fif is on my to check list for ages...

Eccentric J18:12:56

It took me most of the weekend but I finally got my fish-shell prompt just the way I want it after learning about it last week: http://cl.ly/bf605978bf88

pithyless21:12:44

@U8WFYMFRU Looks nice. Have you got a gist up somewhere? As a zsh user I may just be tempted to try the fish shell if I can get a head-start.

Eccentric J21:12:01

I do have the theme and my config within https://github.com/jayzawrotny/dotfiles/tree/master/client/omf. You’ll need to install fish shell, copy the omf directory from the repo to ~/.config/omf, then install oh-my-fish https://github.com/oh-my-fish/oh-my-fish#installation

Eccentric J21:12:53

@U05476190 After that you should be good to go. I was using zsh for a few years up until the end of last week, zsh is great but fish shell is really fast, provides a great shell user-experience, and makes it much easier to script. It even has a lispy philosophy where every value is treated as if it were a list with an emphasis on functions.

pithyless07:12:40

Thanks for the writeup, I’ll try it out over the holidays.

Eccentric J16:12:13

Nice! Let me know if any issues come up getting it to work.

hiredman18:12:08

there is some erlang thing with a very generic name for specifying client/server behavior, it will even sit between a client and a server and throws errors if either party violates the behavior. does anyone know what the name of that is?

mauricio.szabo21:12:35

There's a library only for tests called Pact, if I'm not mistaken. It implements contract tests. Is it something like this that you're looking for?

mauricio.szabo21:12:32

Also, I've implemented this kind of behavior with Prismatic Schema on both services, but I don't believe that there's something that sits between client and server

hiredman18:12:34

I don't think so, this has a kind of specification language you feed in to it that defines the call response between the client and server

manutter5119:12:20

@hiredman are you referring to OTP?

hiredman19:12:50

isn't that just like the standard library? what I am referring to is a concrete thing with a schema language you feed in and you get a thing that verifies the behavior of clients and servers as they exchange protocol messages

mpenet19:12:37

dialyzer? But it's compile time. Otherwise there's no standard validation middleware that I know of, but usually pattern matching at least somewhat validates shapes

hiredman19:12:53

http://ubf.github.io/ubf/ubf-user-guide.en.html#contracts_amp_plugins looks like what I was thinking of (apparently no one uses ubf, which would explain why this was so hard to find)

lilactown19:12:45

oohhhh neat!

hiredman20:12:55

it is very interesting, and in some ways similar to how I've been using graphql, but graphql doesn't include the notion of a connection state (some things are only valid in some states), but happen to be using graphql on a stateful connection

mpenet20:12:58

Interesting

kulminaator22:12:59

just figured out right now that python3 has been crazier change than i though

kulminaator22:12:07

$ python3.6
Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> round(2.5)
2
>>> round(3.5)
4
>>> 

$ python2.7
Python 2.7.15+ (default, Oct  2 2018, 22:12:08) 
[GCC 8.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> round(2.5)
3.0
>>> round(3.5)
4.0
>>> 

kulminaator22:12:32

i understand that this half_even rounding is good for stats but such a thing breaks a ton of code that works on both versions but just gives different results 😐

kulminaator22:12:12

also, please don't do such changes in clojure, pretty please 🙂

todo22:12:19

I've never understood why anyone would use round instead of ceil/floor.

dpsutton22:12:38

that would introduce a systematic skew to results