d_run
2017-2-13 12:21:03

Am making some sort of newbie mistake here with a hash but its making me a little crazy. I have a hasheq in a struct, but when I try to call hash-ref on a key in that hash I get an error. But the key exists -> http://pasterack.org/pastes/63874


leafac
2017-2-13 12:28:09

My first guess is that the two strings "Server" (the first being the hash key and the other the search term to hash-ref) are equal? but not eq?.


d_run
2017-2-13 12:34:38

yeppp… switching to a plain hash solves the issue….


d_run
2017-2-13 12:34:41

!@#$


abhi18av
2017-2-13 13:50:22

Hello racketeers :)

I have an issue, I need your help with. I’m trying to isolate the minimal racket from the main github distribution and the makefile is a definite issue, trying to setup the Travis tests but those fail ’cos of unmodified make file.



abhi18av
2017-2-13 13:50:47

I’d love to work on racket internals)


leafac
2017-2-13 13:55:58

I don’t understand your goal. Minimal Racket already lives in its own directory (https://github.com/racket/racket/tree/master/racket/src). Also, what is the problem with “unmodified Makefile” and TravisCI?


samth
2017-2-13 15:00:07

@abhi18av roughly you just need to delete the pkgs directory to have only minimal racket


samth
2017-2-13 15:02:16

and then just make base will build effectively minimal racket with the regular makefile


abhi18av
2017-2-13 15:22:58

@samth Right. But what if I need to integrate it with .travis.yml with tests.

Are there c-source level tests I can benchmark against, if I make changes.


samth
2017-2-13 15:23:32

@abhi18av what are your goals here?


samth
2017-2-13 15:23:58

to run the most minimal tests, see the racket-test-core pkg


abhi18av
2017-2-13 15:25:16

@samth , actually I’m trying to figure out how the nanopass compiler integrates and how to modernize the c codebase.


samth
2017-2-13 15:26:26

@abhi18av which nanopass compiler? and why would this require changing the repository?


abhi18av
2017-2-13 15:28:11

@samth Mm, the one that Alan keep and Dybvig worked on, I found about racket plans for a new compiler in “inside-racket” videos.


samth
2017-2-13 15:29:55

@abhi18av well, @leif has been working on a new version of the racket compiler using nanopass, but the compiler that Keep and Dybvig describe is for Chez Scheme, not part of racket


samth
2017-2-13 15:30:20

and I don’t think changing the repository is a good way of going about this


samth
2017-2-13 15:30:35

there’s a reason that those things are in the same repository


abhi18av
2017-2-13 15:32:22

@samth and @leafac yes but lately I’ve become really interested in compilers and VMs.

Actually, I need the minimal subset of racket to work with and then port it to, maybe rust or something ( like remacs project) as a learning experience.


abhi18av
2017-2-13 15:33:22

I know typed racket and all other langs build upon this one, so the subset and the base machinery is interesting that way.


samth
2017-2-13 15:33:52

right, but the minimal core language is what’s implemented by racket/racket repo


abhi18av
2017-2-13 15:34:42

Mm, how about gracket. I’d like remove that as well.


samth
2017-2-13 15:34:59

gracket is primarily implemented in the racket/gui repo


abhi18av
2017-2-13 15:35:21

So, what you’re saying is that this is already bare minimum?


samth
2017-2-13 15:35:28

yes


abhi18av
2017-2-13 15:36:26

Hmmm, interesting! I spent the last two days trying to chip things away.


abhi18av
2017-2-13 15:37:01

Btw @samth , the makefile is a bit difficult for me - is here other format I can convert it to?


samth
2017-2-13 15:37:12

no, not really


abhi18av
2017-2-13 15:38:59

Could you tell me whats the plan regarding the c-codebase?

I know that chez has a minimal approach towards C but Guile is more alike


abhi18av
2017-2-13 15:40:00

@samth , there’s a lot of mzscheme etc in the repo as well in codebase - that necessary too?


samth
2017-2-13 16:01:46

The plan is to gradually move things from C to Racket


samth
2017-2-13 16:02:02

you can see some progress on this in the linklet branch of mflatt/racket


abhi18av
2017-2-13 16:03:21

Yes, I’ve been testing in that branch itself.


abhi18av
2017-2-13 16:03:39

But, still some parts would still be kept in C right?


abhi18av
2017-2-13 16:03:44

The GC etc


samth
2017-2-13 16:03:47

the use of mzscheme is historical


samth
2017-2-13 16:04:08

most likely that will stay in C for a long time


abhi18av
2017-2-13 16:05:17

Okay, so I’ve reframed my question. What do I need to remove to have racket build for ubuntu 14.04 – 3m GC only - minimal


abhi18av
2017-2-13 16:05:42

Without dealing with the source files as of yet, and the entire lightning folder can be chipped as well - changes like these.


abhi18av
2017-2-13 16:06:03

Senhora is not used by default, like CGC right


samth
2017-2-13 16:15:19

why do you need to remove source files?


samth
2017-2-13 16:20:16

In general, just run make base and it will build just the core of racket


jerryj
2017-2-13 17:14:30

Can someone help me understand why I don’t see my ’@%expand-envexpand when used inside my@%letrec-parser`? http://pasterack.org/;((%22k%22%20.%20%22(288279%201%2011142559)%22))


jerryj
2017-2-13 17:15:14

hmm looks like i broke pasterack :disappointed:


jerryj
2017-2-13 17:25:40

The core of my question is: "Is it okay to call a syntax-parser from another syntax-parser? it seems to work sometimes but other times it doesn’t.. I know i must be doing something different, but its not clear what.


lexi.lambda
2017-2-13 17:36:22

@jerryj: The answer to your question is “yes”, without caveats. syntax-parser is just a macro for a procedure of one argument that uses syntax-parse, and syntax-parse is just a very fancy pattern-matching construct for syntax objects.


jerryj
2017-2-13 17:37:47

@lexi.lambda Thanks for the confirmation, i guess i need to massage how I have ordered things :]


lexi.lambda
2017-2-13 17:38:26

Try posting your code again? Sometimes you have to wait for pasterack to redirect.


jerryj
2017-2-13 17:41:40

i’ll pop it to a github gist or something. are fragments ok? i don’t know how much context is needed (thank you!!)


jerryj
2017-2-13 17:42:15

actually i’ll just push the whole project to my gh


jerryj
2017-2-13 17:52:55

@lexi.lambda here is the mess: https://github.com/jerry-james/iswim. The macros are in main.rkt, the input file i’m fighting with is under private/test.rkt. I’m trying to make a letrec macro that will build up a global environment and give that global-env to each variable in the letrec.


jerryj
2017-2-13 17:54:44

stuff you’ll see in the code doesn’t make that end-goal obvious, i just tried to get it into a somewhat presentable state..


jerryj
2017-2-13 17:56:05

Oh, Also, my REAL goal is to put a nice front-end onto the redex langs i’m building. I want some facilities for building up environments, i’d like to be able to use a (let ...) instead of manually building up lambdas, etc.


jerryj
2017-2-13 18:14:26

oh no, is it that ..._1 means something different in syntax-parse than it does in redex? :[


lexi.lambda
2017-2-13 18:15:56

could you try and produce a more minimal example?


jerryj
2017-2-13 18:16:20

sure thing!


jerryj
2017-2-13 18:31:06

@lexi.lambda I removed a lot of extra code, so now it just shows the macro not being expanded. the test.rkt contains (letrec ([x 2] [y 3]) (addem x)), which yields '((((letrec ((x 2) (y 3)) (addem x)) (@%expand-env (letrec ((x 2) (y 3)) (addem x)))) mt))


thinkmoore
2017-2-13 18:33:24

jerryj


thinkmoore
2017-2-13 18:33:44

change #:literals to #:datum-literals?


jerryj
2017-2-13 18:34:12

@thinkmoore no dice :disappointed:


thinkmoore
2017-2-13 18:35:03

does DrRacket show a binding arrow for @%expand-env in the module begin macro?


jerryj
2017-2-13 18:35:38

yes, but its the purple ’?’ arrow


thinkmoore
2017-2-13 18:36:29

oh, try (apply-reduction-relation* cek (term ((,form ,(@%expand-env form)) mt)))


thinkmoore
2017-2-13 18:36:37

term is a quasiquote


thinkmoore
2017-2-13 18:37:01

(sorry if that doesn’t work either…. trying to debug from code inspection…)


jerryj
2017-2-13 18:37:41

@thinkmoore my goodness, that certainly did the trick. i’m kind of astonished though, because i didn’t think you could use , inside a #'(...) expression.


jerryj
2017-2-13 18:37:51

i thought you had to use #,


thinkmoore
2017-2-13 18:38:03

the , is to escape the term, not the syntax-quote


jerryj
2017-2-13 18:38:06

i think i must have some deep misunderstanding about something here :disappointed:


jerryj
2017-2-13 18:38:19

hmm..


thinkmoore
2017-2-13 18:38:21

there are multiple types of quoting/unquoting. #, works with #`


thinkmoore
2017-2-13 18:38:23

, works with `


thinkmoore
2017-2-13 18:38:30

and term is basically a `


jerryj
2017-2-13 18:38:45

OH


jerryj
2017-2-13 18:39:02

wow. okay, so that brings it into crystal clarity


jerryj
2017-2-13 18:39:09

thank you @thinkmoore!


jerryj
2017-2-13 18:40:33

@lexi.lambda thank you, too! i’d have never gotten this far without learning how pieces fit together from your racket-tulip project.


jerryj
2017-2-13 21:19:07

SEwPR question, In section 6.4 Why does the cek5 reduction relation drop the environment? is that a typo? edit: nevermind, I think i just misunderstood how to create a recursive environment


assefamaru
2017-2-13 21:29:56

@assefamaru has joined the channel


lexi.lambda
2017-2-13 23:50:52

@florence: I have another errortrace question. Can you explain to me why the (die!) expression is not included in the errortrace for the following code, but the (error ...) and (execute-thunk ...) expressions are? #lang racket (define (good) (void)) (define (die!) (error 'die! "died")) (define (execute-thunk proc) (void (proc))) (execute-thunk (thunk (good) (good) (die!) (good)))


florence
2017-2-14 03:19:02

@lexi.lambda I’m not sure, but if I wrap the body of die! in a void it shows up… So yeah I don’t really know what’s going on there, sorry


samth
2017-2-14 03:23:43

@florence @lexi.lambda isn’t it just that the error is in tail position wrt die?


lexi.lambda
2017-2-14 05:00:06

@florence @samth I am probably totally misunderstanding how errortrace works, but why would the error being in tail position change whether or not (die!) is annotated, since that expression is not in tail position?


lexi.lambda
2017-2-14 05:02:57

My extremely rudimentary understanding of errortrace is that it just inserts a bunch of with-continuation-mark forms all over the program, in application positions, using the source locations of the expanded syntax objects, then changes the error handler to put the information attached to those continuation marks in the error message.


lexi.lambda
2017-2-14 05:04:28

There must be something more complex going on, though, right? Since the expression in with-continuation-mark is in tail position, but errortrace is definitely impacted by whether or not expressions are in tail position.


lexi.lambda
2017-2-14 05:44:44

After playing with continuation marks a bit and reading the section of the documentation on the evaluation model, I think I sort of understand. Continuation marks are attached to continuation frames, but expressions evaluated in tail position replace the enclosing continuation frame, so the mark gets lost.