Leave a comment

Comments 5

pozorvlak February 4 2011, 22:40:29 UTC
Actually, there are three languages involved: the original agda-mode works as follows:

1. Emacs-lisp code constructs Haskell code which calls Agda-interpretation functions with the relevant Agda code passed as a string argument.
2. A slave GHCi process interprets the Haskell code, which in turn interprets the Agda code, and generates elisp code to insert the output into an Emacs buffer.
3. The calling elisp function evals the generated elisp code.

I can't imagine why they implemented it this way. I carefully didn't touch the Haskell-generating functions, but I did have to spend a lot of time in the GHCi interaction window to work out what arguments I needed to pass.

Reply

nealar February 5 2011, 00:28:39 UTC
1. Elisp takes Agda from edit buffer, generates Haskell
2. passes this Haskell (with Agda as argument) to GHCi (with loaded Agda interpreter), getting more Elisp as result of interpretation
3. passes this Elisp back to Emacs where it is interpreted,
right?

Either you or Norrel seem to be kidding, making fun of poor me.

Is there such thing as a multiquine contest?

Reply

pozorvlak February 5 2011, 01:09:13 UTC
That's exactly right, and I swear that's how it works. Have a look at the functions agda2-go and agda2-exec-responses in agda2-mode.el.

I don't think there's a multiquine contest, but Googling turns up a handful of polyglot quines: this Haskell/OCaml/Scheme one, a C/Ruby/Python/Perl/BF one, and a few more here.

Reply


nealar February 4 2011, 23:56:26 UTC
Название ссылки разорвало моск. Боюсь по ней переходить.

Reply

thesz February 5 2011, 08:36:36 UTC
Take a look what author wrote near. There's more than elisp out there. ;)

Reply


Leave a comment

Up