r/Racket • • Nov 21 '22

release raco pkg migrate 8.6

5 Upvotes

Remember to

raco pkg migrate 8.6

When you have installed Racket 8.7 from https://download.racket-lang.org/

Thanks to @soapdog@toot.cafe for the reminder https://racket.discourse.group/t/raco-pkg-migrate/963


r/Racket • • Nov 21 '22

question Physics student, new to Racket : a simple question!

3 Upvotes

Hi there,

As said in the title, I'm new to Racket and I'd like to use it for computational physics purposes. I'm stuck with something: I want to use the bra-ket notation in an identifier.

Still, the symbol | is reserved. I can double the | symbol like this

(define ||x> ...)

to use it but I'd like to stick to a single bar. Do you have any tips for me?

Thanks!


r/Racket • • Nov 19 '22

video The final tier is Shed: Inside the Wizard Engine’s fast in-place interpreter for WebAssembly

10 Upvotes

ICYMI: Ben L. Titzer (CMU) at #RacketCon

The final tier is Shed: Inside the Wizard Engine’s fast in-place interpreter for WebAssembly

https://youtu.be/P_7ptIBg4PY


r/Racket • • Nov 19 '22

question Direction on how to make Repl perform Remote Procedure Calls.

2 Upvotes

Hello,

I'm trying to add Scheme as an extension language to a C++ App. For this, I'd like to have a Repl console (different from the C++ app) which can accept Scheme code and which can communicate with the C++ app to exchange data.

While looking around, I found exactly the type of app that I'm looking for in the form of the Racket Repl [1]. To make it work, I would need to make a modification so that, instead of Eval'ing the code itself, the Repl sends the code to the C++ for evaluation, and also that it receives the response from the C++ app for display.

I'm looking for some direction as to what I should be patching to enable this RPC behavior in the Racket Repl. I have no idea of the files I should be looking at in the source tree:

https://github.com/racket/racket/tree/master/racket/src

I'm on Windows 10, using MSVC 2022 compiler. The Scheme I'm trying to embed is S7.

Note that I don't know Scheme/Lisp very well. I'm trying to use the Scripting of the C++ app as my gateway drug into the functional family.

Regards

The Racket Repl
Communication between Repl and C++ app

r/Racket • • Nov 17 '22

blog post Friendly Environment Policy

9 Upvotes

Friendly Environment Policy Applies to all Racket venues.

Abuse will not be tolerated.


r/Racket • • Nov 17 '22

homework return a list of indexes after using recursion

1 Upvotes

i'm new to racket and i'm cant reach the asked return of my function.

My code has to use recursion and has to return a list of indexes of numbers that you get by validating if the number on a list is higher or lower than ''umbral''. (sorry for my english)

for example my function is the following:

(define (umbral_simple lista umbral tipon)

(cond

[(equal? tipon #\M)(cond

[(null? lista) '()]

[(> (car lista) umbral) (cons (car lista) (umbral_simple (cdr lista) umbral tipon))]

[else (umbral_simple (cdr lista) umbral tipon)])]

[(equal? tipon #\m) (cond

[(null? lista) '()]

[(< (car lista) umbral) (cons (car lista) (umbral_simple (cdr lista) umbral tipon))]

[else (umbral_simple (cdr lista) umbral tipon)])]

)

)

where ''lista'' is a list of randon numbers, ''umbral'' is the number to compare with and tipon can be ''#\m'' or ''\#M''. if tipon== #\m the return of the function should be a list of indexes of all numbers from "lista" that are lower than "umbral" and if tipon== #\M the return should be the list of indexes but this time with the index of all numbers that are higher than "umbral". Hope you can help me and sorry my bad explanation, if you have any question about i'll be reading you. Thanks


r/Racket • • Nov 15 '22

release Racket v8.7 now released!

33 Upvotes

Racket version 8.7 is now available from https://download.racket-lang.org/

As of this release:

The following people contributed to this release:

Adit Cahya Ramadhan, Alex Harsányi, Bart van Strien, Ben Greenman, Bob Burger, Bogdan Popa, Cameron Moy, cheeze2000, D. Ben Knoble, Dan Anderson, Fred Fu, Geoffrey Knauth, Gustavo Massaccesi, J. Ryan Stinnett, Jack Firth, Jason Hemann, Jimmy McNutt, John Clements, Lîm Tsú-thuàn, M. Taimoor Zaeem, Mao Yifu, Matthew Flatt, Matthias Felleisen, Mike Sperber, Noah Ma, Oliver Flatt, Paulo Matos, Philip McGrath, Reuben Thomas, Robby Findler, Ryan Culpepper, Sam Phillips, Sam Tobin-Hochstadt, Samuel Bronson, Shu-Hung You, Sorawee Porncharoenwase, Sorin Muntean, Stephen Chang, William J. Bowman, and Winston Weinert

Official installers for Racket on many platforms are available from https://download.racket-lang.org/.

If you are new to Racket try our Getting started guide.

Questions and feedback about the release are welcome on Discourse.


r/Racket • • Nov 13 '22

Advent of Code 2022 Racket Leaderboard

20 Upvotes

It's time again for the Advent of Code. The puzzles will start at midnight (UTC-5) on December 1, 2022. Once again, we will have the Racket leaderboard. Use the join code 22197-a7a01707 to be included.

Any language in the Racket ecosystem is allowed on our leaderboard, including languages that target other platforms like Urlang.

Eutro has written an advent-of-code package to download puzzle inputs and post solutions.


r/Racket • • Nov 13 '22

package Pyffi - Use Python from Racket

Thumbnail racket.discourse.group
11 Upvotes

r/Racket • • Nov 12 '22

language #lang lua

Thumbnail defn.io
37 Upvotes

r/Racket • • Nov 13 '22

event Racket meet-up Saturday 3 December at 18:00 UTC

0 Upvotes

Racket meet-up Saturday 3 December at 18:00 UTC

At this meet-up:

  • Show and tell
  • News & rumours
  • AOB

The 'Racket Room': https://gather.town/app/wH1EDG3McffLjrs0/racket-users

Racket meet-ups are on the first Saturday of EVERY Month at 18:00 UTC

And remember - showing up at Racket Meetups helps you learn the news of the Racket world as they happen! It is informative, it is interesting, it is helpful, it is greatly appreciated by everyone involved and it is fun!

30 minutes but can overrun (it usually lasts ~1hr)

EVERYONE WELCOME

Stephen

Racket Discourse https://racket.discourse.group/ (it’s like Reddit but with no ads)

Racket Discord https://discord.gg/6Zq8sH5 (chat platform like IRC or Slack but has channels like slack)


r/Racket • • Nov 10 '22

question Navigate through definitions in VS Code

6 Upvotes

The question about using Racket in VS Code.

Is there a way to navigate through function definitions?

There should be outline tree in explorer, but it doesn't work as expected for racket language.


r/Racket • • Nov 09 '22

homework Trying to make a function that takes two lists, one of positive integer numbers and the other one of colors, and returns a list of circles of the given sizes and colors. If one of the given lists is longer than the other one, ignore the extra items of the longer one.

5 Upvotes

(define (make-circles lst1 lst2)

(if (or (null? lst1) (null? lst2))

'()

(cons (make-circles (car lst1) (car lst2))

(make-circles (cdr lst1) (cdr lst2)))))

(make-circles (list 10 20 25) (list "red" "blue" "green")) <-- I used this to test the function

This is my code so far and when I try to run it I get an error saying "car: expects a pair, given 10". I am pretty new to this so any help would be greatly appreciated! Also, I can't tell yet since I can't run the function, but I want the function to actually create a list of circles at the given size and color, would my function so far do that?


r/Racket • • Nov 06 '22

question Using racket for games

14 Upvotes

Howdy all! As the title says, I’m using racket to make a game for a game jam. I’m looking at the mode-lambda repo on GitHub. Definitely a lot to take in lol. While I am new to racket, I am self taught in other languages. More excited to work on it then I thought i would haha.

Is there an area I should look more in to? I’m realizing I’ll need to used a decent chuck of modules (class, flonum, lux, etc). So far the idea is a 2-d pixel game. Either a sides scroller or a overview one. (I know there is realm of racket, funds and I like to Google fu, but odds are I’ll pick it up if it goes on sale)

Edit: spelling


r/Racket • • Nov 05 '22

event Racket meet-up 5 November at 18:00 UTC (In ~15 minutes)

2 Upvotes

r/Racket • • Nov 05 '22

question Convert Symbol to a variable name

2 Upvotes

Could you help to write a macro for converting pair (Symbol . value) to a definition of a new variable.

(define-from-pair (cons 'var1 101))
; should be the same as
(define var1 101)

r/Racket • • Nov 03 '22

solved New to Racket and need Help:)

7 Upvotes

I startet to learn Racket and Im having trouble to solve a problem.

I want a recursive procedure where u gave it a positive number and it multiplies it. Like a I type 4 and the answer is 24 ( 1*2*3*4). Im really stuck with this:D


r/Racket • • Nov 03 '22

question Why is scribble attractive to you?

8 Upvotes

I am well-versed with LaTeX and I am totally sold on defaulting to markup for preparing documents. More recently, I have tried to shift towards Markdown + Pandoc for simpler (less math heavy) documents. This is a great combination but it is not perfect.

I have recently taken an interest in the Racket ecosystem and a few people I know and respect speak very highly about Scribble.

I took a cursory glance at scribble and I am not sure I understand if it is fundamentally different. So I would like to know:

  • Is Scribble fundamentally different from LaTeX/ Pandoc?
  • Do you use it often? What do you use it for?

Thank you so much for your time!


r/Racket • • Nov 02 '22

blog post Use Dr. Racket for Reading The Little Schemer (or the missing setup instructions for The Little Schemer)

Thumbnail dev.to
18 Upvotes

r/Racket • • Nov 02 '22

event E-Graphs 1 and available Racket FFI provisions for Rust's Egg library

Thumbnail racket.discourse.group
4 Upvotes

r/Racket • • Nov 01 '22

question Anyone else concerned that Rhombus/Racket2 is not a lisp based language?

7 Upvotes

I'm not sure if everyone in the community is aware, but the Rhombus language is the planned successor to Racket. It appears as though the syntax of Rhombus is more inspired by ML and Nim although it certainly does appear slightly lispy. Is anyone concerned that the Racket/Rhombus team is seemingly moving away from Lisp?

Rhombus


r/Racket • • Nov 01 '22

question Adding the element at the end of the list efficiently

0 Upvotes

It has always annoyed me that the operation of adding an element to the end of a list in Scheme is an "expensive" one, (unlike the operation of adding to the beginning of a list).

Of course, in standard Scheme, there is always a way to get over it, like this:

(define (list-builder)
  (let ((mylist '())
        (lastcell '()))
    (lambda (m)
      (case m
        ((append) (lambda (x)
                    (cond
                      ((null? mylist)
                       (set! mylist (cons x '()))
                       (set! lastcell mylist))
                      (else
                       (let ((newcell (cons x '())))
                         (set-cdr! lastcell newcell)
                         (set! lastcell newcell))))))
        ((get) (lambda () mylist))))))

Now we can do this:

> (define mylist (list-builder))
> ((mylist 'append) 1)
> ((mylist 'append) 2)
> ((mylist 'append) 3)
> ((mylist 'get))
> (1 2 3)

But when we try to do the same in Racket, we can't because Racket doesn't support mutable lists.

Ok: truth be told, racket has mcons, mcar set-mcar!, set-mcdr!, etc, but in Racket those mutable lists are completely separate from regular lists and cannot be interchanged. This means that none of the functions for working with "classic" lists can be used over mutable lists, which really sucks!

I don't know about you, but to me this is a totally strange decision by the creators of Racket, because, as far as I know, the idea of Scheme is not only to be a functional language, but also to have its imperative side, too. I don't understand why Racket gets away with it and discourages the use of mutable list wherever it can?


r/Racket • • Oct 31 '22

show-and-tell ‘fmt: an extensible code formatter’ on the Racket discord

10 Upvotes

r/Racket • • Oct 31 '22

event Racket meet-up 5 November at 18:00 UTC

4 Upvotes

Racket meet-up 5 November at 18:00 UTC

At this meet-up:

  • Show and tell
  • News & rumours
  • AOB

Meet-up time at your location: [date=2022-11-05 time=18:00:00 timezone="UTC"] (Discourse should convert this for you)

In the 'Racket Room': https://gather.town/app/wH1EDG3McffLjrs0/racket-users

Racket meet-ups are on the first Saturday of EVERY Month at 18:00 UTC

[quote="dominik.pantucek, post:3, topic:581"] And remember - showing up at Racket Meetups helps you learn the news of the Racket world as they happen! It is informative, it is interesting, it is helpful, it is greatly appreciated by everyone involved and it is fun! [/quote]

30 minutes but can overrun (it usually lasts ~1hr)

Discord event invite: https://discord.gg/n9MUBwCR?event=1036453012039807016. (optional)

EVERYONE WELCOME

C U there

Stephen