Live data from Hacker News

Beautiful Racket

beautifulracket.com

51–55 of 55 posts

Re: Beautiful Racket

#51
post #48

Earlier quoted context omitted.

"find an embeddable Prolog compiler for your language of choice (e.g., MiniKanren for Racket), and then simply emit a flat list of Prolog equations out of your source language AST (do the lexical scoping pass first). Easy. And easily extendable to dependent typing and all that fancy stuff." So, you represent the AST associations and type-checks as Prolog logic rules that operate on predicates describing the AST? And…

For example, you have an AST node for 'x + 2', encoded as 'apply(apply(var("+"), var("x")), const("2"))' (we're talking about ML, so it is curried here). Firstly, all the expression nodes must be annotated with type tags: 'A1:apply(A2:apply(A3:var("plus"),A4:var("x")), A5:const("2"))'. Then your typing pass walking over this segment of AST would generate the following (mostly trivial) equations A5=integer // from con…

You've sent me way down the rabbit hole here. I'm going back and reviewing Prolog for the first time in years (at least the syntax isn't strange since I've been using Erlang recently).

I don't quite understand this phrase "you'll get all An type values to attach to your AST". Do you just mean "all type values" or is "An type" a technical term?

Re: Beautiful Racket

#52
post #32

Earlier quoted context omitted.

I'm not who you're asking the question to, but I dislike DrRacket because (when I used it last year) it took too long to load (iirc, intellij started up faster and they have to support a lot more features)

The IDE i use (phpstorm) - i load it once, and it just sits in the background until i restart or logout. I can't see how load time is really a big deal? unless you're talking 5+ min?

I normally close my programs when I'm not using them, out of habit

Re: Beautiful Racket

#53
post #51
post #48

Earlier quoted context omitted.

For example, you have an AST node for 'x + 2', encoded as 'apply(apply(var("+"), var("x")), const("2"))' (we're talking about ML, so it is curried here). Firstly, all the expression nodes must be annotated with type tags: 'A1:apply(A2:apply(A3:var("plus"),A4:var("x")), A5:const("2"))'. Then your typing pass walking over this segment of AST would generate the following (mostly trivial) equations A5=integer // from con…

You've sent me way down the rabbit hole here. I'm going back and reviewing Prolog for the first time in years (at least the syntax isn't strange since I've been using Erlang recently). I don't quite understand this phrase "you'll get all An type values to attach to your AST". Do you just mean "all type values" or is "An type" a technical term?

I think they meant you'll get the type for A1, A2 etc.

Re: Beautiful Racket

#54
post #51
post #48

Earlier quoted context omitted.

For example, you have an AST node for 'x + 2', encoded as 'apply(apply(var("+"), var("x")), const("2"))' (we're talking about ML, so it is curried here). Firstly, all the expression nodes must be annotated with type tags: 'A1:apply(A2:apply(A3:var("plus"),A4:var("x")), A5:const("2"))'. Then your typing pass walking over this segment of AST would generate the following (mostly trivial) equations A5=integer // from con…

You've sent me way down the rabbit hole here. I'm going back and reviewing Prolog for the first time in years (at least the syntax isn't strange since I've been using Erlang recently). I don't quite understand this phrase "you'll get all An type values to attach to your AST". Do you just mean "all type values" or is "An type" a technical term?

Sorry for a confusing wording. I was referring to the newly generated tag variables A1, A2, ..., An. The next typing pass after solving the equations is to substitute those tags with the type values found by Prolog.

Re: Beautiful Racket

#55
post #54
post #51

Earlier quoted context omitted.

You've sent me way down the rabbit hole here. I'm going back and reviewing Prolog for the first time in years (at least the syntax isn't strange since I've been using Erlang recently). I don't quite understand this phrase "you'll get all An type values to attach to your AST". Do you just mean "all type values" or is "An type" a technical term?

Sorry for a confusing wording. I was referring to the newly generated tag variables A1, A2, ..., An. The next typing pass after solving the equations is to substitute those tags with the type values found by Prolog.

Ah perfect, thanks.

This whole thread has been a huge boon to me, very glad for all the input.

Post reply on HN