
resyntax
can migrate define-struct
forms to struct
forms pretty effectively now! https://github.com/racket/scribble/pull/295

You should create a macro that avoids all these #:extra-constructor-name
s :yum:

Is there a way to embed the relevant linux libraries within a stand alone executable built with raco exe --orig-exe
?

I found this by @ryanc https://github.com/racket/racket/issues/3306 but I’m not sure how much is related, although the linked SO post seems to be about the same issue

I’m pretty sure that you can.

I remember experimenting with this a bit in the past while trying to make portable linux binaries

Cool, that would be great. If you happen to remember any details at all, that could be useful :slightly_smiling_face:

Oh, and I meant to also embed libs like libc

okay, yeah i figured

i don’t remember if i got raco exe to staticly link anything, but i don’t think it should be too hard

I used define-runtime-path
and the libs do seem to get embedded (the binary’s size increases), but it looks like the executable does not look for them there, so I’m probably missing some steps

I didn’t copy/link them first in local directory though

At the same time, I don’t know how to tell the executable to use a local version of libc

So… I created a lib
subdirectory and symlinked there all the relevant libs (libc, libpthread, etc.). In the code, I have (define-runtime-path libc.so.6 "lib/libc.so.6")
...
Then I did: (export LD_LIBRARY_PATH="lib"; raco exe --orig-exe myprog.rkt)
but ldd myprog
still reports global paths like: libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f26ebc0c000)

Shared objects will not get embedded by raco exe
. Using define-runtime-path
makes them included in a distribution created by raco dist
at a path relative to the executable. So, they get bundled with the executable in that sense, but not embedded in a single file.
There’s no way to relink shared objects into a single executable, if that’s really what you had in mind. You’d have to link static libraries to create a new executable, which is outside of anything raco exe
tries to do.

Just curious, but what does the ’++lib" option to ‘raco exe’ do?

That refers to a Racket library, not a shared object or OS library.

Ok, gotcha, I’ll try to find another way then. Thanks

Ok, that is what I expected but wasn’t entirely sure.

Hi, in my custom #lang
I’d like to read numbers according to the same rules as racket, i.e. "3+4i"
is read as a complex number without having to redefine lexing/parsing for it in my language. Is there an easy way to do that, please?

If you peek ahead in the port and see the next character is a number or a #
you can just do (read port)
to get the next datum out

(assuming numbers and hash marks don’t have any other special significance in your #lang. You can ignore the #
part if you don’t need to parse some of the fancy special cases the Racket reader can handle: https://docs.racket-lang.org/reference/reader.html#%28part._parse-number%29)

Ah yes, I should have thought of that. This should work perfectly, thanks! :+1:

:smiley: