Live data from Hacker News

Defunctionalization: Everybody Does It, Nobody Talks About It

blog.sigplan.org

21–23 of 23 posts

Re: Defunctionalization: Everybody Does It, Nobody Talks About It

#21
post #14

The authors work seems very interesting, and could maybe lead to the automatic generation of a language server with semantic query and refactoring capabilities, for any programming language. Or portable (in the 'language to language' sense) static analysis tools or interpreters or symbolic execution tools... Just wondering (out loud) how you formalize language semantics so they can be consumed... I know about grammar…

Most people formalize "kernel languages" that contain all the bare essentials of the language at hand. There are a variety of tools to do this; a lot of people just end up embedding their language semantics in Coq or something and writing proofs about the theories there. Alternatively, a lot of people will tend to just write literal interpreters for their kernel language in a language like Haskell or OCaml; interpret…

Thanks a lot for this answer and the references.

I think the author is working on a generic semantic tool to generate all kinds of language tooling automatically ; I'll be sure to follow his work.

Re: Defunctionalization: Everybody Does It, Nobody Talks About It

#22

> defunctionalization, a transformation that replaces higher-order functions with equivalent first-order ones. For anyone else who got nothing from the title.

I admit to fawning for functional languages like Haskell, Clojure and OCaml for fun, but it seems like they are not more popular because having many additional, higher-order constructs makes code “obsfucated” behind clever features rather than written as simply as possible (but no simpler). Maybe for a coding shop full of insane geniuses (i.e., quants, CalTech aerospace, physicists or Stanford research department) it…

This genius talk is so wrong. I have an bachelors in engineering from a state school. I've worked in Haskell with multiple people with no computer science education. You don't need to be a genius to know Haskell, and knowing Haskell doesn't make you a special genius.

And in my experience, the Haskell codebases I've worked in best exemplify the axiom you mention. I've solved so many problems by barely using my brain thanks to FP.

The main prerequisite is a good attitude.

Re: Defunctionalization: Everybody Does It, Nobody Talks About It

#23
post #14

The authors work seems very interesting, and could maybe lead to the automatic generation of a language server with semantic query and refactoring capabilities, for any programming language. Or portable (in the 'language to language' sense) static analysis tools or interpreters or symbolic execution tools... Just wondering (out loud) how you formalize language semantics so they can be consumed... I know about grammar…

Most people formalize "kernel languages" that contain all the bare essentials of the language at hand. There are a variety of tools to do this; a lot of people just end up embedding their language semantics in Coq or something and writing proofs about the theories there. Alternatively, a lot of people will tend to just write literal interpreters for their kernel language in a language like Haskell or OCaml; interpret…

By the way I kept going down this rabbit-hole and found an example of what you described : https://unsat.cs.washington.edu/projects/serval/

IIUC Serval uses an interpreter built in Rosette (?) to build a Symbolic execution tool.

Post reply on HN