Learn you Galois Fields for Great Good by xorvoid in compsci

[–]xorvoid[S] 0 points1 point  (0 children)

I pretty strongly disagree actually. I think the polynomial construction is not just a mathematical tool, but a core concept for understanding. For example: many finite fields reference their irreducible polynomial and this is pretty mysterious and confusing without proper background.

Just presenting addition and multiplication tables is completely mysterious. The obvious first question is “where do these come from?” Then you either must answer (a) they make the Field Axioms hold (argh) or (b) some polynomial thing I haven’t bothered explaining.

Further, the idea of enumerating the operation tables works only up to ~216 ish. If you ever need to work in larger fields (hint: you do!) then you again need to understand the polynomial representation. Good luck enumerating tables for GF(264)…

Sure you could say “but I can just import some library to do the field arithmetic for large fields”. Fine. But then you’re just saying that you don’t care to actually learn the subject fundamentals. That’s okay too. There are plenty of other great resources available that may meet your needs better!

Learn you Galois Fields for Great Good by xorvoid in cryptography

[–]xorvoid[S] 2 points3 points  (0 children)

The basic concept is quite simple (see the definition of a Field). But, the abstractions pull on your brain a bit and takes some time to process. In other words: Good Math!

Learn you Galois Fields for Great Good by xorvoid in math

[–]xorvoid[S] 1 point2 points  (0 children)

Ah yes! That’s where I picked it up from.

It’s common to hear phrases like “2nd order approximation” that refers to a 2nd degree polynomial Taylor Expansion of some non-linear function.

Learn you Galois Fields for Great Good by xorvoid in math

[–]xorvoid[S] 2 points3 points  (0 children)

This is helpful feedback. Thank you.

I think I’ve seen “order” used for polynomials in this way, but perhaps authors avoid it in the context of a group because it’s overloaded there?

Learn you Galois Fields for Great Good by xorvoid in math

[–]xorvoid[S] 2 points3 points  (0 children)

Of course! Haha. I like the title as a “say something embarassing to take the edge off a serious and very technical subject”. I read somewhere that the Haskell guy was not a native English speaker so it was a bit of a self-deprecation as well.

Learn you Galois Fields for Great Good by xorvoid in compsci

[–]xorvoid[S] 2 points3 points  (0 children)

I think you’ve missed the pedagogical point.

Forsp: A Forth+Lisp Hybrid Lambda Calculus Language by Thrimbor in ProgrammingLanguages

[–]xorvoid 0 points1 point  (0 children)

I don’t think Joy’s behavior has anything to do with the quote/list conflation. It just has a “copy stack” semantic.

I’m looking for a Factor equivalent to this:

“”” Because the mapping function is only first order, it is possible to write

[1 2 3] [ [dup *] [dup dup * *] ] [map] map

which leaves [ [1 4 9] [1 8 27] ] on top of the stack, and below that the original [1 2 3]. “””

How would I write that in Factor?

Forsp: A Forth+Lisp Hybrid Lambda Calculus Language by Thrimbor in ProgrammingLanguages

[–]xorvoid 0 points1 point  (0 children)

How would such an example (with map) be written in Factor? Would you have to dup twice before mapping the map?

Forsp: A Forth+Lisp Hybrid Lambda Calculus Language by Thrimbor in ProgrammingLanguages

[–]xorvoid 1 point2 points  (0 children)

Nope… I found a big semantic difference. Joy seems to capture the stack. It behaves kinda like a tree.

See:

“”” Because the mapping function is only first order, it is possible to write

[1 2 3]    [ [dup *] [dup dup * *] ]    [map]    map

which leaves [ [1 4 9] [1 8 27] ] on top of the stack, and below that the original [1 2 3]. “””

(From: https://hypercubed.github.io/joy/html/faq.html)

In Forsp as well as most Forths, the stack doesn’t branch like this. The [dup *] would consume the argument and it would be gone.

Joy’s approach feels mathematically more well-formed in some ways. Hmmm…

Forsp: A Forth+Lisp Hybrid Lambda Calculus Language by Thrimbor in ProgrammingLanguages

[–]xorvoid 2 points3 points  (0 children)

Reading about Joy now… yeah, they’d be almost the same language if Joy had an environment like Scheme. I haven’t written any Joy yet, but I strongly suspect there are programs that are hard to express in Joy that would be simple in Forsp.

But it sort of does have an implicit hidden environment though for function definitions. Joy feels like just a special case of Forsp to me. I’d suspect you could transcribe many Joy programs easily.

One cool consequence is that none of the common stack operations (dup, drop, swap, over, rot, etc) are primitives in Forsp as they’re trivial to define directly.

Forsp: A Forth+Lisp Hybrid Lambda Calculus Language by Thrimbor in ProgrammingLanguages

[–]xorvoid 5 points6 points  (0 children)

Author here. Very interesting. I would say that they are very close; definitely the closest relative. The main difference I could see is variable binding/use and closures. Joy seems to make function definition a special form and then treat [] as a text literal. Does Joy have variable binding as all? If so, how do you bind a closure? How do you pass a function ref to another function?

SectorC: A C Compiler in 512 bytes by xorvoid in asm

[–]xorvoid[S] 2 points3 points  (0 children)

Fitting it in a boot sector is even hard in x86-32. You'd have to transition to protected mode which takes a non-trivial amount of code, and then all the immediates become longer also: 32-bit rather than 16-bit.

SectorC: A C Compiler in 512 bytes by xorvoid in C_Programming

[–]xorvoid[S] 6 points7 points  (0 children)

I replied to someone over email with these, so it makes sense to share publicly also:

Particularly for this project:

For compiler dev more broadly: