yfangzhe
2020-12-7 08:37:33

Wow, never thought it is so complicated. Thanks for your pointing.


lupino8211
2020-12-7 08:59:57

Guys, i process custom language and generate unbound identifiers that should bind in runtime, but racket spits “unbound identifier error”… What should i do to fix it?


soegaard2
2020-12-7 10:36:36

I am assuming your language works like this: your language -> (your compilation) racket + macros -> (normal Racket expansion) expanded Racket The unbounded identifier error is must come from the last step.

One way to find such an error: • write an example in your language • hand compile it into racket+macros • run you hand compiled example If your hand compiled example doesn’t run, you can debug it “normally” (that is with out worrying about the language implementation details).

If it does run, then you need to check, where your compilation step results in some other than the expected.


soegaard2
2020-12-7 10:37:08

If you can find a minimal example, where you get the error, then ask about the minimal example here.


lupino8211
2020-12-7 12:19:27

Yep, I understand this May I rephrase myself, generalizing what i want to do?

I want to read at compilation time some external file, process it to S-expressions and use definitions from it. What is the right way to do this?


soegaard2
2020-12-7 12:20:33

Best resource I know: https://beautifulracket.com/


mflatt
2020-12-7 12:22:39

I think define-inline doesn’t work as intended. It’s trying to avoid inlnining recursive calls, but it ends up disabling inlining within arguments to an inlined call. You can see that via raco expand of #lang racket/base (require racket/performance-hint) (define-inline (f x) (list x)) (f (f 0)) Someone could try swapping the order of syntax-parameterize and let* on lines 102–104 of collects/racket/performance-hint.rkt to see whether that’s better.


laurent.orseau
2020-12-7 13:11:36

Would begin-encourage-inline work differently?


ben.knoble
2020-12-7 14:03:03

@ben.knoble has joined the channel


wanpeebaw
2020-12-7 14:11:31

@laurent.orseau 4.3s - no different from the original version.


wanpeebaw
2020-12-7 14:27:09

@mflatt This really surprised me. IIUC, applying the same function repeatedly is not recursive calls.


mflatt
2020-12-7 14:32:24

I think the author of define-inline (not me) didn’t intend to treat arguments the same as recursive calls, but that’s what the implementation currently does.


ben.knoble
2020-12-7 14:32:32

Anyone know a decent scribble syntax plugin for vim ? The Vimscripts one linked from the racket/vim page is not working as well as I would like.


phanthero
2020-12-7 14:36:25

Not an answer (and I also don’t mean to be a downer), but most people here are using Emacs (from what I understand), which has much better support for Racket and Scribble. I switched over to Emacs from Vim myself just for the better lisp/Racket support.

Even the vim-racket plugin had many indentation issues, and seems like it is not being currently maintained

It is unfortunate that the racket/vim page is out of date though, that should be fixed indeed :slightly_smiling_face:


lupino8211
2020-12-7 17:09:55

You can write your own syntax highligther in vim https://learnvimscriptthehardway.stevelosh.com/chapters/46.html


ben.knoble
2020-12-7 17:10:56

Oh trust me @lupino8211 I’m aware; syntax is just one of the harder parts of vim customization (and not something I’ve dived deeply into). It probably will come down to doing so, though. When it happens, I’ll release it and let people know.


badkins
2020-12-7 23:06:15

Is there a built-in function to filter a hash table? I’m not finding it, but thought I’d check before I write one.


sorawee
2020-12-7 23:08:10

Is your hash mutable or immutable?


sorawee
2020-12-7 23:08:41

If immutable, you can use for/hash along with in-hash and #:when clause


badkins
2020-12-7 23:10:25

I expect I’ll want to filter both, but the one at present is immutable. I think I’d prefer (hash-filter hsh fun) over using for/hash aesthetically.


sorawee
2020-12-8 01:35:02

I think a part of the problem is that hash-map exists, but it returns a list instead of a hash.


sorawee
2020-12-8 01:35:31

So if you add hash-filter, it would be awkward to return a hash.


kellysmith12.21
2020-12-8 03:34:38

I learned that the Racket compiler uses partial type reconstruction to eliminate redundant runtime type tests. Does it also do something like that for contract checks?


sorawee
2020-12-8 03:41:02