lexi.lambda
2017-4-18 18:33:19

@samth: do you think you could answer some simple questions about the Complete and Easy Bidirectional Typechecking paper? or is it mostly unfamiliar?


samth
2017-4-18 18:33:30

I haven’t read that paper


lexi.lambda
2017-4-18 18:33:50

alright, I figured I’d ask


lexi.lambda
2017-4-18 18:34:09

I might ask the authors some questions but my questions are likely extremely trivial


cowbs
2017-4-18 18:39:19

@cowbs has joined the channel


stamourv
2017-4-18 21:14:53

@ben: Frog is unhappy with the blog post in your PR:


stamourv
2017-4-18 21:14:56

2017–04–18-type-tailoring.md: Ignoring unknown metadata: “Tags:”


stamourv
2017-4-18 21:15:06

error: 2017–04–18-type-tailoring.md: Must start with metadata but missing Tags


stamourv
2017-4-18 21:15:18

Interesting combo. :)


greg
2017-4-18 22:12:52

ruh roh. @stamourv @ben If this is a recently-updated Frog — it might be something broke when adding optional new Authors tag, that my tests don’t catch? Can I get a link to the PR and 2017-04-18-type-tailoring.md so I can try?


ben
2017-4-18 22:31:14


ben
2017-4-18 22:31:35

I was using Frog 0.25


ben
2017-4-18 22:32:13

looks like Vincent fixed this by adding a whitespace after “Tags:” https://github.com/racket/racket-lang-org/commit/10938be21db3bcb2b6ce95730e4d44cafe2f59c0


ben
2017-4-18 22:34:00

whoa @stamourv @greg , is _hello_ different from *hello* in frog? EDIT: nevermind they look the same on Frog 0.26


ben
2017-4-18 22:34:16

(I’ll go ahead & test this now, I’m just surprised about <https://github.com/racket/racket-lang-org/commit/2dd32dae23ad64b3d06bd83ad861dfcb0e375e80>)


stamourv
2017-4-18 22:46:49

@ben: May be the same. As I was debugging, I was just trying to get it as close to one of the working blog posts as possible. :)


stamourv
2017-4-18 22:47:41

@greg: I was using the latest frog, and what ben pointed out is what was causing me trouble.


notjack
2017-4-18 23:29:56

@mflatt Do you have time to answer some general questions I have about linklets, Racket-on-Chez, and module serialization?


greg
2017-4-18 23:30:54

@stamourv @ben Thanks! Logged and will push a commit to fix. https://github.com/greghendershott/frog/issues/189


mflatt
2017-4-19 00:29:59

notjack: yes


stamourv
2017-4-19 01:19:04

@greg: Thanks!


notjack
2017-4-19 01:59:14

Thanks! Feel free to answer these whenever you get a moment:

1) How do linklets handle phases? Can linklets import each other at different phases? Does that question even make sense? 2) Do linklets match one to one with modules? If I have modules A, B, and C, and a main module M, does compilation first create four individual linklets, then a single linklet that represents M with A, B, and C included, then that linklet is converted to a Chez Scheme module and then a binary by the Chez compiler? 3) How much work is done “ahead of time”, that is in the module->linklet translation? Can I perform optimizations on the linklet of module A which is required by module B without knowing about B? 4) Are linklets always serializable? If not, when aren’t they?


mflatt
2017-4-19 02:18:14

1) linklets are phase-independent. A module is composed of multiple linklets, one for each phase level


mflatt
2017-4-19 02:19:25

2) If A, B, C, and M have no compile-time part, then four linklets will be generated. But if some of the have code at phases other than 0, there will be more linklets


mflatt
2017-4-19 02:20:35

3) Linklets are separately compiled; they’re not necessarily independently compiled, because cross-linklet optimization might happen for a linklet of B that imports a linklet of A (but that cross-linklet optimization is not yet set up in the Chez implementation)


mflatt
2017-4-19 02:23:03

4) It’s possible to create a non-serializable linklet via 3-D code, the same as a non-serializable module (i.e., with something non-serializable under a quote); if a linklet originates from something that read-syntax produces, then it will be serializable (assuming no cross-linklet optimization involving a 3-D-derived linklet)


mflatt
2017-4-19 02:24:04

Linklets are not serializable in the sense of serialize; when you put them in a linklet bundle, then the linklet implementation knows to serialize them when written


notjack
2017-4-19 02:29:07

1) What are the platform-specific parts of the Racket-module to Chez-compiled binary process? Does the module->linklet transformation or linklet optimization involve anything platform specific?

2) What is a linklet bundle?

3) Are linklets Racket-version specific?


notjack
2017-4-19 02:29:56

Oh, and 4) How much of this process is deterministic?


mflatt
2017-4-19 02:44:12

1) module-to-linklet compilation is platform-independent; the linklet compilation process is platform-dependent on Chez 2) a “linklet bundle” groups linklets for a module; a “linklet directory” groups bundles for a module and its submodules (and linlet directories also serialize when written) 3) effectively yes, since macros from racket/base can change the full expansion, and therefore the linklet compilation; the bytecode form of a compiled linklet on the Racket VM is also version-specific 4) like the current bytecode compiler, the module-to-linklet and linklet-to-bytecode (for the Racket VM) pipeline is meant to be determinsitic – but there are probably some little problems right now due to a hash table or gensym here and there


notjack
2017-4-19 02:47:39

One more I can think of: how much compile-time code is “optimized away”? If module A imports module B at phase 1 for utilities in defining some macros and does not export those macros, only uses them, does linklet compilation expand the macros and remove the dependency on B?


notjack
2017-4-19 02:48:31

Similar question for when module A imports macros from module B, how is that reflected in the linklets?


notjack
2017-4-19 02:51:55

For background I’m daydreaming about a distributed build system for Racket, something with high scalability that used a distributed blobstore instead of a filesystem to store artifacts like linklets. Any thoughts you have on that would be most appreciated :)


mflatt
2017-4-19 02:53:04

The linklet for A’s run-time code will not use any linklets from B, but the module layer will keep the dependency as usual. Still, having linklets separated out can be useful to something like a demodularizer. For example, the flattener that is applied to the expander’s own implementation in linklet form gathers only the linklets that are actually used or that end up at phase 0 and may have side effects, and linklets from any other phase can be ignored


mflatt
2017-4-19 02:54:03

I don’t know whether it helps for something like a distributed blobstore, but maybe


notjack
2017-4-19 02:55:16

The important bit is that building package A and package B that both use package X triggers a series of distinct actions like “convert module X into phase linklets” and individual linklets are stored, so they end up reused across machines without having to rely on a shared build environment


notjack
2017-4-19 02:59:38

This has been really helpful though, thanks a lot :) Good luck on the Chez work, that plus the Racket-powered expander seems like a huge step forward for Racket!