Pinned toot

Humanitarian crisis in Bangladesh Show more

Hey everyone, when writing a compiler, should I have an AST for the target language that I generate, then format into a string, or should I emit the string directly?

Okay, I figured out the problem.

`TOKEN; <DataConstr>` doesn't work; only `nonterminal; <DataConstr>` does. The source location annotation includes the data constructor but not its arguments.

Gah! Does no longer insert annotations in the generated code that map locations to grammar file source locations? I'm migrating to the new syntax and have a type error that points to some location in the generated code...

Apparently, got a new syntax... I wonder if the old syntax still works; I'll update the package later and see.

I have to read a Java textbook for school, and in today's reading, I read:

"It is usually not good practice to use more than one return statement in a method. In general, the return statement should be the last line of the method body."

This claim is utter crap. Early returns can make the logic much clearer than that of, say, a gratuitous "ret" variable.

Hmm, I want my programming language implemantation to run on the web via js_of_ocaml. Should I write my own interpreter, emit JS and use eval (if eval is unsafe here, then the compiler is unsafe, right?), or pull in the Wasm package, emit Wasm, and either use the built-in VM or the browser implementation?

Will the Wasm package work on the web or will treating ints as JS numbers break things...?

GitHub changed the color of the Rust bar from brown to red...

Anime Show more

github.com/xavierleroy Xavier Leroy isn't an Inria researcher anymore?

(His GitHub profile states that he isn't now.)

In A-Normal Form, can the let binding RHS be a let expression? I've seen some definitions that allow it and some that don't... In particular, matt.might.net/articles/cesk-m allows it but still makes the exp/cexp distinction, even though the exp and cexp definitions can be combined if the RHS can be an exp.

Compare that definition with this one that doesn't allow the RHS to be a let expression: matt.might.net/articles/a-norm

I have crossed the Rubicon and merged the mutable references feature into the master branch of my compiler! Now, my programming language is officially imperative!

TAH boosted
Check out Alyssa Rosenzweig's summer internship wrap up -- this talented intern made some amazing contributions to the mission of software freedom! https://u.fsf.org/2pb

is a focus on the object-oriented paradigm instead of more universal ideas. Would only having pure functional programming be the same mistake? Should my programming language be functionally pure like Haskell or imperative like OCaml?

evaluation order and laziness or strictness. Therefore, I think that pure functional programming might have a niche in educational programming languages. However, apparently people who learned Haskell as a first language had difficulties with imperative languages, and all mainstream languages are imperative. Should an educational programming language teach about mutation? (SICP covers mutation, after all!) Would having something like ST be enough? IMO a problem with mainstream teaching (cont.)

programming complements Bret Victor's recommendations in an interesting way. State passing is explicit as one does not change some hidden global state, as Bret Victor criticizes in Processing's graphics API, but rather passes fresh values reflecting the new information. In pure functional programming, the control flow that Bret Victor recommends be explicit is instead completely abstracted away; code is merely a mathematical description and aside from _|_, output is independent from (cont.)

in the back of my mind. A while later, I submitted the Scratch-influenced GP language to r/programminglanguages, and another person lamented that it was "yet another language that visualizes the wrong thing," linking to worrydream.com/#!/LearnablePro, how I first found about Bret Victor. In Learnable Programming, Bret Victor recommends making time, state, and control flow explicit and visual. I'm at the point where I need to think about IO for my language. I think that pure functional (cont.)

Over the past few months, I've been working on an ML dialect. My original idea was to make an educational programming language, like Scratch but better informed by PLT, as I believe that Scratch gets "wrong" the fundamental ideas of programming that it should be teaching. On r/programminglanguages, another person advised me not to belittle the user, but to make a PL that I would use myself. So, now I've been treating my language as a general-purpose one, keeping the purpose of education (cont.)

What if the real blockchain is the transactions we made along the way? 🤔

Show more
Functional Café

functional.cafe is an instance for people interested in functional programming and languages.