
@t Hey, thanks for this project! I made a pull request with some projects I follow or maintain: https://github.com/avelino/awesome-racket/pull/2

Pushed

@robby Is there any way to “split off” a DrRacket tab into a separate window, or is the only way to close the tab and open the same file again in a new window?

That’s the only way I know. Improving seems merely like a small matter of programming. ;)

Thank you @mflatt ! I’ll build from the HEAD and give it a try

Okay, I figured as much, but I thought I’d ask. Maybe I will try adding it at some point, but probably not today. :)

@mflatt In the program #lang racket
(let ()
(define-syntax foo (make-rename-transformer #'values))
(foo 1))
I realize that getting Check Syntax to understand the structure of the RHS of the define-syntax
is largely a lost cause with the current communication channels in place, but I wonder if it couldn’t at least recognize the use of define-syntax
itself. Does it make sense for the internal-definition context → letrec-syntaxes+values
transformation to add/propagate 'origin
properties somewhere so that uses of define-syntaxes
are tracked?

It looks like letrec-syntaxes+values
is already smart enough to propagate 'origin
properties on syntax binding pairs, so the transformation would just need to attach the 'origin
property to the right spot.

I’m learning #lang slideshow
for my RacketCon talk. Does anyone have or know of presentations with source code that I could look at as examples?

@philip.mcgrath do you want really impressive ones or simple ones?

Either/both?


here’s a very impressive one from @robby https://github.com/rfindler/icfp-2014-contracts-talk/

Thanks!

here’s a pretty simple and short one of mine: https://github.com/samth/iu-intro-2014

here’s a library containing a simple slide (and some complex stuff for the picture in it): https://github.com/samth/lang-slide

@orl has joined the channel

Does anyone have a link to a sample repo that illustrates the “languages as libraries” approach that’s not typed racket?

I want to give something to some students about this, but typed racket is too ambitious for them to understand, I think.

@krismicinski do you just want a repo that implements a language?

or do you want something that works somewhat like that paper?

or something else?

Ideally, something that follows the paper’s technique of doing a local expand on the module and then walking over forms to transform them

Merely adding macros via an module lang sexpr won’t be enough, for example.

So “implements a language” is maybe, but I think “works somewhat like that paper” is closer to what I want.

To give some context, we want to work on our own language following this technique, and could roll it from scratch using this paper, but I wanted to see if there was anything to give students that might illustrate the idea a bit more concretely

right now you can use it as a #lang reader ..

But for the kinds of expansions we want, we need to be able to walk over and transform things like identifiers

@krismicinski languages the racket way(lwc 2016), and herbarium racketensis(icfp 2017) both sort of fit what you’re looking for, both work through some of the steps of building a language and related tooling. I’m away from a computer right now but I can send you links to the papers and repos later if you can’t find them

thanks for the pointers

@leif is video-lang a good example? I was just looking at this now..

Sure. IIRC, the crux of what you want is in main.rkt
and the video-begin
function in base.rkt
: https://github.com/videolang/video/blob/master/video/main.rkt

(For the front end language.)

(I also used plenty of DSLs all throughout the implementation.)

Yeah, I was just looking at that and that seems like what I want

Okay cool. :slightly_smiling_face:

I’m sure there are other examples

and I should also look into those

If you have any questions, and/or improvement thoughts please let me know .:)

video-lang seems like a medium-sized one

My frank guess is that I’ll have to take a week or two to digest it

we’ve realized that we need to walk over variable bindings for our language to work, so just using plain macros won’t be enough, I’m sure we’ll just have to pull info from a few sources

but my students probably aren’t strong enough to just read the typed racket code just yet

Oh, honestly, I think the smallest (and cutest) one that I have is #lang sml.

ah ok

(Which is not standard ml, but the s-markup language).

I wrote it in about an hour after getting annoyed at things like YAML.


oh I’ve seen this actually.


just forgot about this

Ya, I…err…didn’t write any comments in it, because it was just a quick hack.

But it’s super convenient. Like, my calendar, and even resume use it.

right, I think the biggest hurdle for my students (and me) to tackle is the various interrelated ways of hacking these things up. I’m not really a macro or racket expert, so this is mostly me kicking things along


nice!

Fair.

There are about 3–5 tricks that go into that, namely

Namely, 1. Lifting out expressions so the code can be a data definition.

- Using ‘paren-shape’ to distinguish between
(
,{
, and[
.

- Any free identifiers ending with
:
are treated as a symbol.

And 4. Using {{
for string literals. (Sadly that one was the hackiest. and is responsible for about half of the code.)

I should write a blog post on it.

Anyway, if you have any questiosn, feel free to ask. :slightly_smiling_face:

I don’t quite get what you mean by (1): what is a data definition in this context?

Maybe I should try to grok your code more, it probably will make sense once I get it. Something like you need to isolate out the code from the non-code, since your language is meant to work with non-code stuff, and you need to pull that up into a big block before the main evaluation actually runs to create (e.g.,) your cv

Is that approximately the right idea?

Oh, sorry, I just meant, I want the default context to be just data.

Like, in a latex file, by default you’re typing prose, and you have to use some language form to go to another context.

Or like html, or scribble.

Does that make more sense?

yeah that makes sense

this looks great

I think it’ll be some good fodder

this + video-lang will give some good stuff to have students dig into

Okay cool. I look forward to seeing how it goes. :smile:

@krismicinski, have you come across Beautiful Racket (https://beautifulracket.com)? Its tutorials involve implementing several languages, including a Basic interpreter with variables, gotos, subroutines (gosub), and even functions. I only recently worked through it and haven’t read the languages as libraries paper yet so I’m not sure it’s what you’re looking for. I found it very helpful for getting over my fear of planning new language projects using Racket.

By the way, @leif, I recently watched your video-lang talk and really enjoyed it. I’m eager to poke around in the code to learn how the custom GUI controls are implemented. Providing visual programming DSLs, if that’s the right way to put it, seems super useful!

@krismicinski & @jacob.d.mitchell I concur, beautiful racket is great. It doesn’t go into many of the super duper advanced bleeding edge things, but it does show you how to do some cool things with languages as libraries.

Also, @jacob.d.mitchell thanks. ^.^ The existing GUI code is somewhat boring, you can find it in player.rkt
: https://github.com/videolang/video/blob/master/video/player.rkt

And private/editor.rkt
: https://github.com/videolang/video/blob/master/video/private/editor.rkt

(The first being the video-canvas that allows you to embed videos into any racket program (including slideshows), the second being the prototype gui editors.

This repo: https://github.com/videolang/idmt contains the current state of my non-textual (visual) macro’s experiment. But its still very early days for that.

Thanks to @lexi.lambda and her RacketCOn talk a few years back. ^.^

Yes, I’ve read through beautiful racket, but I don’t think it covers much of the languages-as-libraries approach, unfortunately

That book is very helpful for most of the cases you’d want

But we need to rewrite core parts of the AST, unfortunately, including things like variables, etc..

(Specifically, our language has nuanced interactions with state, so we need to do things like rewrite variable occurrences to forms that call out to maintain the secrecy of various variables)

I think the languages as libraries paper is a good reference, the idea of doing a local-expand at the toplevel module definition, then doing your own work, that really is what we’re going to need, I think.

I’ll let you all know as we keep hacking on it

I’m sure there are a variety of ways to do it once you really know the internals of the macro system

@david.emily has joined the channel

greetings

did someone else also experience that same error when using typed racket? http://pasterack.org/pastes/8526

when moving that stuff into a different module and providing it from there to the other one it type checks without problems. But that is just weird and something i don’t want.

wooo. found a good workaround \o/.