jesse
2020-7-22 08:31:15

I’m not sure to whom to write about this, so I’ll just post this here: on the Racket snapshots page (https://www.cs.utah.edu/plt/snapshots/) , shouldn’t it say “ARM64” instead of “ARM6”? The same presumably applies to the in-progress 7.8 download page


jcoo092
2020-7-22 08:38:38

Not necessarily, actually. There’s concepts in ARM processors of ARMv6 and ARMv7 (at least), where the instruction sets aren’t compatible - i.e. they’re different compilation targets. Whether that is relevant here or not, I’m not sure.


jcoo092
2020-7-22 08:47:57

(I might have the slightly wrong - I find the myriad ARM variants a bit confusing myself)


jesse
2020-7-22 09:51:17

or is that really ARM6? (I’m looking for the AArch64 snapshots. Perhaps I’m misreading things; maybe AArch64 isn’t yet available as a snapshot, and “ARM6” really is, well, “ARM6”.)


jesse
2020-7-22 09:52:50

@jcoo092 that’s for sure!


jesse
2020-7-22 09:53:10

(sorry for the huge delay in my messages — I had closed my laptop lid while connected to a really bad network…)


jcoo092
2020-7-22 09:54:51

Honestly, I’m not sure precisely which ARM version it is targeted towards. So far, I haven’t tried to poke my nose into that area with Racket. Hopefully someone who knows what they’re talking about (unlike me) comes along soon and gives a definitive answer.


jcoo092
2020-7-22 09:55:06

Either way, :+1::skin-tone–2: for trying to point out a possible error


racket741
2020-7-22 09:57:15

@racket741 has joined the channel


jesse
2020-7-22 09:57:50

maybe Racket is targeting the Apple Newton? Always possible, but would be awfully surprising. (Just to give you an idea of how olde ARM6 is.)


jesse
2020-7-22 09:58:19

cross-compiling Racket on Raspbian, intended for the Newton


jcoo092
2020-7-22 10:05:21

Gotta write software for those PDAs somehow


mflatt
2020-7-22 11:52:10

Adding a “v” to make it “ARMv6" would indeed be a better label. I think it’s v6 because that matches the original (current?) Raspbian configuration, where the Pi 1 has a v6 processor.


spdegabrielle
2020-7-22 12:31:40

Can I suggest just ‘Raspberry Pi OS’ ; • it’s a well known and documented platform so if you are using another ARM-based system you probably already know if it will be compatible. • Raspbian got renamed when it got upgraded and moved to Debian buster in May. • Of course this may change when the 64bit version of Rpi OS comes out of beta.


mflatt
2020-7-22 12:36:05

Yes, when the dust settles on various build changes, I’ll look into updating the Utah snapshot from an ancient Raspbian distribution to a current Raspberry Pi OS.


jesse
2020-7-22 12:51:21

@mflatt thanks for clarifying


acorso522
2020-7-22 13:13:31

@acorso522 has joined the channel


st8l3ss
2020-7-22 16:36:41

I’ve had success running Ubuntu 20.04 LTS 64-bit on the Raspberry Pi 4 recently. Don’t think I’ll ever go back to Raspbian.


st8l3ss
2020-7-22 16:37:37

Feels like a real Linux desktop.


spdegabrielle
2020-7-22 17:25:22

st8l3ss
2020-7-22 18:00:56

because Ubuntu 20.04 is LTS not beta


st8l3ss
2020-7-22 18:01:32

I do a lot of things in Docker containers


st8l3ss
2020-7-22 18:01:52

so I pull Docker images and run them on my Pi 4


cris2000.espinoza677
2020-7-22 19:41:22

[SOLVED, but looking for a more elegant and less hacky solution] i want to evaluate a custom language, i’m basing off this <https://groups.google.com/forum/#!topic/racket-users/1NvXO6dpMd4|How to eval a custom language from inside a module? - Google groups> but i don’t understand all of the nuances, i’m going to reply to this thread with the code to show what does work right now, because i can evaluate the custom language but only on the repl of the file where my custom eval is.

the problem is, it cannot open the module the expander is in, because the path gets resolved at runtime. the thread above says something about something similar that but i dont exactly understand how to fix it for my problem


cris2000.espinoza677
2020-7-22 19:42:16

#lang racket (require racket/runtime-path) (require "reader.rkt" "expander.rkt") (provide eval-str eval-quoted) (define-runtime-path expander-path "expander.rkt") (define-namespace-anchor here) (define ns (namespace-anchor-&gt;namespace here)) (parameterize ([current-namespace ns]) (namespace-attach-module ns expander-path)) (define eval-str (let ([has-required? #f]) (λ (code-str) (define code-datum (read (open-input-string code-str))) (begin0 (parameterize [(current-namespace ns)] (eval code-datum)) (unless has-required? (set! has-required? #t) (parameterize [(current-namespace ns)] (eval '(require 'tag2-lang-mod)))))))) (define (eval-quoted quoted) (parameterize [(current-namespace ns)] (eval quoted)))


soegaard2
2020-7-22 19:44:23

Do you have an expander in “expander.rkt”?


cris2000.espinoza677
2020-7-22 19:44:40

yes


cris2000.espinoza677
2020-7-22 19:44:57

ik that is the problem, it’s resolved at runtime


cris2000.espinoza677
2020-7-22 19:46:22

i just dont understand how to fix it the module the codes evaluates to ends up being (module tag2-mod-lang "expander.rkt" ...)


cris2000.espinoza677
2020-7-22 19:47:24

tag2-lang\eval.rkt:22:10: open-input-file: cannot open module file module path: C:\documents\scripts\racket\eh-searcher\expander.rkt path: C:\documents\scripts\racket\eh-searcher\expander.rkt system error: no such file or directory; rkt_err=3


cris2000.espinoza677
2020-7-22 19:48:57

i want to fix it without changing the reader if possible, otherwise i suppose i have to use unquote along with the path resolved already of the expander

EDIT: this doesn’t work, a fully resolved path isn’t recognized as a module path.

EDIT2: also i didnt edit the reader i just modified the eval function (define eval-str (let ([has-required? #f]) (λ (code-str) (define code-datum (read (open-input-string code-str))) (define fixed-code-datum (append (take code-datum 2) (list (path-&gt;string expander-path)) (drop code-datum 3))) (begin0 (parameterize [(current-namespace ns)] (eval fixed-code-datum)) (unless has-required? (set! has-required? #t) (parameterize [(current-namespace ns)] (eval '(require 'tag2-lang-mod))))))))


soegaard2
2020-7-22 19:59:51

I think I am missing something, but shouldn’t (eval code-datum) be (eval (my-expand code-datum)), where my-expand is the expander you have defined in “expander.rkt” ?


cris2000.espinoza677
2020-7-22 20:02:23

but the read function from "parser.rkt" returns a datum with the form (module tag2-mod-lang "expander.rkt" ...) so when it gets evaluated it, the expander applies itself to that module body


soegaard2
2020-7-22 20:03:46

Okay. So the question in a nutshell is, how to get (eval '(module foo "bar.rkt" ...)) to work?


cris2000.espinoza677
2020-7-22 20:07:39

ok so the way the language is set up is that in expander there is a list called queries


cris2000.espinoza677
2020-7-22 20:08:02

(define-values (add-query! queries) (let ([queries '()]) (values (λ (query) (set! queries (list* query queries))) (λ () queries)))) (define (last-query) (define qs (queries)) (if (empty? qs) #f (first qs)))


cris2000.espinoza677
2020-7-22 20:08:32

the unless part in the eval-str is for a dirty trick


cris2000.espinoza677
2020-7-22 20:09:28

once i evaluate the module inside the namespace, i require it so the codes executes it, only once is needed then i just can evaluate without the require


cris2000.espinoza677
2020-7-22 20:10:06

as i said it works on the repl of the file the eval is in, that is eval.rkt


soegaard2
2020-7-22 20:10:06

Instead of:

(parameterize [(current-namespace ns)] (eval '(require 'tag2-lang-mod)))))) maybe you can use namespace-require ?

(parameterize [(current-namespace ns)] (namespace-requrie 'tag2-lang-mod))


soegaard2
2020-7-22 20:26:58

I am wondering, whether you should try

(define-runtime-path expander-path "expander.rkt")

in the expander, and then use (module tag2-mod-lang &lt;insert expander-path here&gt; ...)


cris2000.espinoza677
2020-7-22 22:54:31

sorry for not answering my internet was down for the former it didn’t work, for the latter already tried it here https://racket.slack.com/archives/C06V96CKX/p1595447337169400?thread_ts=1595446882.168000&amp;cid=C06V96CKX


cris2000.espinoza677
2020-7-22 22:54:56

but i found a solution, although not too elegant and most likely a hack


cris2000.espinoza677
2020-7-22 22:55:22

#lang racket (require racket/runtime-path) (require "reader.rkt" "expander.rkt") (provide eval-str eval-quoted) (define-runtime-module-path expander-path "expander.rkt") (define-runtime-path this-folder ".") (define-namespace-anchor here) (define host-ns (namespace-anchor-&gt;namespace here)) (define ns (make-base-empty-namespace)) (parameterize ([current-namespace ns]) (namespace-attach-module host-ns expander-path) (namespace-require 'racket) (namespace-require expander-path)) (define eval-str (let ([has-required? #f]) (λ (code-str) (define code-datum (read (open-input-string code-str))) (define code code-datum) (begin0 (parameterize [(current-namespace ns) (current-directory this-folder)] (eval code)) (unless has-required? (set! has-required? #t) (parameterize [(current-namespace ns) (current-directory this-folder)] (eval '(require 'tag2-lang-mod)))) )))) (define (eval-quoted quoted) (parameterize [(current-namespace ns) (current-directory this-folder)] (eval quoted)))


cris2000.espinoza677
2020-7-22 22:56:58

that is the final eval.rkt, I changed many things so i dont know how all of them combined make it work, but the key for it to work was changing the current-directory to the one the eval.rkt belonged to, which is the same as reader.rkt


cris2000.espinoza677
2020-7-22 23:00:24

problem seems, that the namespace is very polluted… it has racket and expander.rkt which i believe maybe shouldnt. also while the language i made doesn’t rely on current-directory i still don’t like it as a solution, since i might make something it uses it in the future… although setting that to another identifier and then passing it could be a workaround for this workaround


cris2000.espinoza677
2020-7-23 00:27:06