conrad.steenberg
2019-8-17 20:15:09

@notjack I was thinking of a converter to s-expressions (badly phrased sorry) as a pedagogical tool to learn how honu maps to the current syntax :)


conrad.steenberg
2019-8-17 20:18:27

The question I’m trying to answer is: How would Honu look like as a surface syntax for e.g. guile, or another scheme.


notjack
2019-8-17 20:43:48

@conrad.steenberg that’s interesting! Kind of like a reader-level version of the macro stepper, maybe?


conrad.steenberg
2019-8-17 21:49:32

Yes, good analogy - or like being able to dump the output from the first pass of a multipass compiler.


philip.mcgrath
2019-8-18 00:00:56

@conrad.steenberg I’ve barely looked at Honu, but does honu-read do what you want? #lang at-exp racket (require honu/core/read) (honu-read (open-input-string @string-append{ // A for loop that iterates between two bounds. for x = 1 + 5 to 10 do printf("x is ~a\n" x) // Similar to above but shows a block of expressions in the body for x = 1 to 10 do { var y = x + 1; printf("x ~a y ~a\n", x, y) } // A for loop that iterates over a list of numbers for x in [1, 2, 3] do { printf("x ~a\n", x); } })) produces: '(for x = 1 + 5 to 10 do printf (#%parens "x is ~a\n" x) for x = 1 to 10 do (#%braces (%semicolon var y = x + 1) printf (#%parens "x ~a y ~a\n" honu-comma x honu-comma y)) for x in (#%brackets 1 honu-comma 2 honu-comma 3) do (#%braces (%semicolon printf (#%parens "x ~a\n" honu-comma x))))


samdphillips
2019-8-18 00:26:03

I think it still needs an enforestation step so it is closer to racket


conrad.steenberg
2019-8-18 00:37:00

Agreed :) Thanks for the answer though!