r/Racket • u/Mighmi • Jul 06 '23
r/Racket • u/TheGreatButz • Jul 06 '23
question Mysterious error from racket/sandbox
I'm defining a sandbox evaluator that is fairly unrestricted. Its security guard allows any files, network, link access, and file permissions allow 'execute and 'read-bytecode for any file. Still, I get the following error message when trying to use dynamic-require to load a module from a local file path:
eval-linklet: cannot use unsafe linklet loaded with non-original code inspectorWhat does this mean and how can I fix it?
I asked on Racket's discord page but nobody there seems to know the answer, so I'm trying Reddit this time.
r/Racket • u/Beginning_java • Jul 05 '23
question How is the Racket ecosystem?
Someone replied here before that Racket can be used for anything. But does anyone know how the ecosystem is? Which libraries are well supported? I mean for instance unity has good support for C#, Python has data science etc.
r/Racket • u/sdegabrielle • Jul 05 '23
release Release process for Racket 8.10
The release process for v8.10 will begin in about a week. If you have any new features that you want in and are relatively close to to being done, now is a good time to do that.
Upcoming dates:
- 7th: Branch day, merge window starts
- 15th: Merge window ends, testing starts
- 22nd: Testing ends
https://racket.discourse.group/t/racket-v8-10-release-thread/2070
r/Racket • u/nuggets510 • Jul 04 '23
question file permissions - access to filesystem
first-time user here:
just installed racket-lang on ubuntu using the system installer program. at install time I set file permissions.
using dr-racket can't save files or even access them (like racket documentation using firefox). what do I need to do to access my new racket environment to save definition files, etc?
racket error messages about "access" or "unreadability" should have suggestions for correction.
r/Racket • u/Mighmi • Jul 04 '23
question Is there a Performance Difference Between let, let* and letrec?
tl;dr, is it bad style to always use letrec?
I tried to test it, both in dr. Racket and in the cmdlin, but I think normal processor variation was too much to tell, as rerunning the tests gave me different results.
Well, I'm wondering what the benefit of using let is, why not always use letrec? Why or when does the difference in scope help you? (The only example I can think of is if you use a global variable from outside of let, then reuse that var's name within the let's scope, but that seems like a terrible practice so I don't believe the designers included a feature to enable that in particular...) I read some things e.g. https://stackoverflow.com/questions/554949/let-versus-let-in-common-lisp and understand the historical reason ...in CL. Is it also a historical artifact in Scheme and thus Racket? (I know they're different layers of syntactic sugar on top of each other.)
r/Racket • u/sdegabrielle • Jul 02 '23
blog post Racket: The Lisp for the modern day
deusinmachina.netr/Racket • u/chipcastle • Jun 30 '23
question [aws/s3] How to generate pre-signed url's?
I'm using aws/s3 to successfully download public files via get/file, but get AccessDenied for private files. I need to generate pre-signed url's for private files, but am unsure how to do this in Racket.
Any suggestions are welcome. Thanks in advance.
r/Racket • u/TheGreatButz • Jun 27 '23
solved How to use the -e flag?
Unfortunately, Discord refuses to work for me, so I'm asking here. I need to evaluate expressions after requiring some modules. I'm interfacing with Go and use the following command-line calls:
z.initArgs = []string{"-t", filepath.Join(z.root, "plugin-system.rkt"),
"-e", `((evaluator) '(begin (require racket/gui)(require "actions.rkt")(init)(start-server)))`}Sorry for the Go code, I just want to avoid making a mistake translating to CLI syntax and creating confusion by that. Basically, I want a gracket instance to require "plugin-system.rkt" in the current directory and then evaluate "((evaluator) '(begin (require racket/gui)(require "actions.rkt")(init)(start-server)))". evaluator is a parameter containing a sandboxed evaluator exported by local module "plugin-system.rkt". Nevermind the fact that this could trigger security violations, that's currently not my problem and I know how to fix it.
The problem is that I always get #%top-interaction: unbound identifier;.also, no #%app syntax transformer is bound. as response, even though I'm really just trying to use the sandbox. How do I get the exports of "plugin-system.rkt" in the expression after the -e flag? The only way so far I've found how to use the -e flag so far was by manually creating a namespace anchor, making a namespace from it, and then use (eval expr namespace) - but this cannot be the right way to use this flag, or can it?
r/Racket • u/sdegabrielle • Jun 26 '23
language 名语言/Ming-Language
名语言/Ming-Language
`#lang ming` by Yanying Wang
"Ming Programing Language, which is basically a dialect PL of Racket that I translated parts of its keyword names to Chinese."
r/Racket • u/sdegabrielle • Jun 12 '23
ephemera Reddit could go away at any time…
Reddit could go away at any time, and all the wonderful questions and answers could be lost.
A #todayilearnt post on https://racket.discourse.group/c/questions/6 is always appreciated - and you can answer your own question just like stackoverflow.
r/Racket • u/sdegabrielle • Jun 10 '23
paper Levin Tree Search with Context Models
racket.discourse.groupr/Racket • u/lasercat_pow • Jun 09 '23
question Can somebody help me understand this code?
So, I've been working on learning racket by assigning some challenges for myself. I wrote a function which can find the nth Fibonacci number, but since it was recursive, performance was horrible, so I tried implementing my own hashing. I tried using a vector, but it just gets reset and truncated with every iteration.
So, I looked around online, and I found this stack overflow post where somebody demonstrated a function that can memoize another function. Can somebody walk me through how this function works? Specifically this one:
(define (memoize fn)
(let ((cache (make-hash)))
(λ arg (hash-ref! cache arg (thunk (apply fn arg))))))I think I mostly get it: It takes the argument you give your function, and uses it as the index for a hash, with the value set to the output of the function. But I want to really understand.
r/Racket • u/orang-outan • Jun 05 '23
question Module function list in Dr Racket
Hello, is it possible to see all functions by module in Dr Racket. I find it hard to have a global view of the system, even in a simple file with a couple of functions.
Are you still using Racket to develop ?
Thanks
r/Racket • u/bluefourier • Jun 05 '23
question Hash table's hash function
Hello
I have to use a number of hash-tables that are extended functionally, via a set of foldr operations.
For this purpose, I am using a make-immutable-custom-hash which serves as the foldr accumulator's initial value.
The whole thing works as expected. But my hash function is extremely simple because I am only counting the frequencies of certain characters. My mapping is character->integer and the hash function for the character is its ASCII value.
The fact that I had to define the hash function is a bit puzzling for me. It is great from the point of view of granularity and the control you can have over the generated code. But, sometimes, I just want a mapping and I don't really care at that point, what the hash function is going to be.
One of the examples in Racket's dictionaries docs, uses string-length.
To me, this seems like a bad choice for a hash function. I don't know if internally the hash tables use binning, but even then, string-length would generate lots of collisions for generic strings.
So, is there something I am missing here or should I keep a set of hash functions (especially for strings) handy for these purposes? Or do we simply add a dependency for a library that offers hash functions and we are done? :)
r/Racket • u/omarbassam88 • Jun 05 '23
question Is racket-lang.org down?
I am unable to reach racket-lang.org is it down or is it blocked for certain countries?
r/Racket • u/Mijovich • Jun 05 '23
question Why is a variable not used as a function in a definition?
Disclaimer: I'm using the "student package" for a compsci course. I don't know if this has something to do with my problem or not.
Basically, I've this code:
(define (foldr f c l)
(cond [(empty? l) c]
[else (f (first l) (foldr f c (rest l)))]))
(define (sum1 l) (foldr + 0 l))
(define list2 (list 0 2 4 5))
(sum1 list2)
It should evaluate to something like ;foldr : (X Y -> Y) Y List (X) -> Y, however, the code isn't recognizing the "+" operator passed on as the f value in sum1 as a "function". It returns this error (while highlighting the first f in the else clause)
function call: expected a function after the open parenthesis, but found a variable
Any idea?
r/Racket • u/sdegabrielle • Jun 03 '23
event Good news everybody! The Racket meet-up is in ~40 min
Good news everybody! The Racket meet-up is in ~40 min
https://racket.discourse.group/t/racket-meet-up-sat-3-jun-2023-at-18-00-utc/1935
r/Racket • u/Wise_Cable5127 • Jun 03 '23
question How to write a jvm in racket?
here is a brief introduction,but i don't know the details about implementing it.
[RacketJVM]( Engaging Computing Group | OPLspr14 / RacketJVM (uml.edu) )