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.
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.
Comments 5
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
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
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
Reply
Reply
Leave a comment