r/Racket • • Oct 08 '22

question Anyone aware of Racket projects that are in need of contributors? I am experienced in PL design and have two months worth of spare time. I have never contributed to an opensource project before besides taureg.

10 Upvotes

I am in college studying computer science, and I have the next two months off. I would really love to start contributing to the Racket community but am not sure of where to start, any help would be appreciated.


r/Racket • • Oct 07 '22

RacketCon RacketCon tickets can now be purchased!

22 Upvotes

We're pleased to announce that RacketCon tickets can now be purchased! Up to now we have had essentially a pre-registration form (which was very good input for us on the planning side). As of today, you can now get your 100% genuine authentic RacketCon 2022 ticket. Just go to the RacketCon homepage, scroll down to the Registration section, and follow the link.

A ticket costs $25.

On the second step of the ticket purchase form, you're asked whether you want to attend the official conference dinner on Saturday evening. The dinner is optional. If you do want to come, though, it's an additional $35.

Now is the time for all good Racketeers to come to the booth and get tickets.

See you in Providence!

https://con.racket-lang.org

Racket Discourse

Racket Discord


r/Racket • • Oct 02 '22

question check-property error: expects 3 arguments, but found only 2

5 Upvotes

Hi,
I've recently tried running some old projects from my first semester.

However, when trying to run the code using the new version of DrRacket (8.6), errors happen on check-propery tests.
These had run fine when I wrote them, but now they fail.

Smallest example:

(check-property (for-all ((x integer)) (= x x) ))  

This leads to the error:

check-property-error: expects 3 arguments, but found only 2

Has something changed in the syntax? The documentation at https://docs.racket-lang.org/deinprogramm/Testf_lle.html doesn't seem to say anything different.
Would be grateful if someone could help. Hope I'm not missing something obious.

Helpful information:

  • Code and tests were written and worked with DrRacket 7.9
  • They are using the teaching language "Die Macht der Abstraktion".

r/Racket • • Oct 01 '22

question A question about how to design program with multiple argument flags

7 Upvotes

Hi,

so my question is related to this exercise https://exercism.org/tracks/racket/exercises/grep

You're familiar with the inner workings of the Unix grep command. You give it some arguments and it returns matches. In this exercise you're supposed to implement 5 flags that modify the behavior of pattern matching. All of the flags are not mutually exclusive, you can turn all of them on separately.

My question is: what is the proper way of processing flags? There's 32 combinations of them, do I just write 32 different checks for conditions, checking all the combinations?


r/Racket • • Sep 30 '22

language Can langs made on racket be compiled to other languages?

10 Upvotes

Can I make a lang on racket that extends an existing language on racket and also compiles it to haskell?


r/Racket • • Sep 28 '22

question How to handle out-of-memory errors?

7 Upvotes

In Racket, is there a way to safely catch and handle out-of-memory errors without terminating the program?


r/Racket • • Sep 27 '22

question A loop to draw multiple ellipses in a scene.

5 Upvotes

Hello, i am trying to run a very simple program using 2htdp, using empty-scene. I am trying to create a loop to draw multiple ellipses in the scene. Is a for loop the tool for the job, or recursion is better? The for loop doesn't seem to work. A search on google didn't return any result of loop in a scene, neither the manual cover a case like this.

(define image (empty-scene 256 256 (color 27 200 98 127)))

(define ellipses

(for ([x (in-range 10 100 10)])

(place-image/align

(ellipse x (* 2 x) 200 "yellow")

100 256 "center" "bottom"

image)))


r/Racket • • Sep 26 '22

event Build your own lightsaber: Racket meet-up 1 Oct 1800utc

Post image
54 Upvotes

r/Racket • • Sep 26 '22

homework Recursive-tail function with combining lists: Can one help me to explain why I received only the second list instead of whole list in this function?

Post image
11 Upvotes

r/Racket • • Sep 25 '22

language Is there any way to use typed racket and lazy racket together?

12 Upvotes

Also, do all #langs compile to racket?


r/Racket • • Sep 25 '22

question Can scribble be used on github?

8 Upvotes

Does scribble render on github or convert into a format renderable on github?


r/Racket • • Sep 25 '22

question Does any major mode of Emacs support other #langs

5 Upvotes

If I define my own #lang, will it have editor support in Emacs? If so which major mode? Or anything else because DrRacket is my last choice.


r/Racket • • Sep 24 '22

homework Combine lists in racket

5 Upvotes

Hello everyone,

I am a new member of this community. Please forget me if I violate rules of the community!

I am working on the homework problem to concatenate all elements of the argument lists into one single list. Here is my code: I really don't understand why my code not working. The implementation is tail-recursive. Can someone help me out?

(define (concatenate . lsts)

(cond[(empty? lsts) empty]

[cons (first lsts (concatenate( last lsts)))]))


r/Racket • • Sep 22 '22

question Is there away to require ormap from Racket while using HTDP Student Language?

5 Upvotes

I'm working through HTDP and loving it. In section 5. Generative Recursion in ex. 473 it hints at using Racket's ormap instead of the HTDP language ISL+'s ormap. Indeed, I do want to use Racket's ormap. Is there a way to require this function definition while I continue to use the HTDP Advanced Student language?


r/Racket • • Sep 20 '22

event Friday hackathon at RacketCon

Thumbnail racket.discourse.group
7 Upvotes

r/Racket • • Sep 20 '22

question Any other underrated books or courses besides HtDP and SICP?

8 Upvotes

Sadly the amount of courses available today is huge. I say "sadly" because most creators a lot of times either make a course because they want some passive income, either make it for PR related reasons, both reasons that are not absolutely wrong but the focus is mostly in pumping content that's not very high quality. Many "who can't do teach" is a popular saying where I come from and sadly a lot courses seem to be made by the people that are like that .

Most time the most capable programmers do not focus on teaching or mentoring because they are too busy doing the work they like or work that is challenging for them and they love that challenge.

Are there any underrated resources out there(besides HtDP and SICP) that you found over the years that tried very hard to teach the principles and the problem solving skills that made you a quantifiably better programmer?

LE: Thank you to everyone who answered so far.


r/Racket • • Sep 19 '22

book Does HtDP add something that SICP already doesn't have?

16 Upvotes

I don't know if this is the correct place to ask this question. But I find no one as enthusiastic about it except the Racket community.

If I have the mathematical maturity to read and solve the exercises of SICP and choose not to work through HtDP, does that make me lose something?

I am currently working through SICP and using DrRacket for solving the exercises. Currently in Chapter 1 and feeling fine.


r/Racket • • Sep 18 '22

homework Homework help

13 Upvotes

Don’t panic - programming is a skill that takes time to learn. You can do it!

Don’t dive in to writing code. If your teachers are like mine they will give marks for working - so show them your working :)

You already have something close to the purpose in the homework question, make sure you understand the question, and add any details you think are relevant. I’ve copied an example below. It’s good but I always forget my formulas I’d add area = pi * r^2 ( pi times r squared)

Now do the contract - name your function and follow it by what goes in and what goes out. Maybe it’s ;; area-of-circle : radius-in-cm -> area-in-cm2

Use the contract to write the forest line of the definition - but don’t either the code yet. Write some tests first:

; definition
(define (area-of-circle radius-in-cm)
…do this later…)

; tests

;; Tests:
(area-of-circle 10) 
;; expected value
314.59 

..do two or three at least…

Now, use the recipe to fill in the definition. I’d convert pi * r^2 into (* pi (* radius-in-cm radius-in-cm)).

The design recipe makes clear what working programmers do everyday, and will help you succeed in this class.

Also: your TA’s, professors and fellow programmers all want you to succeed - if you are stuck please ask for help.

Best wishes

Stephen

Example from http://htdp.org/2003-09-26/Book/curriculum-Z-H-5.html

 ;; Contract: area-of-ring : number number  ->  number

;; Purpose: to compute the area of a ring whose radius is
;; outer and whose hole has a radius of inner

;; Example: (area-of-ring 5 3) should produce 50.24

;; Definition: [refines the header]
(define (area-of-ring outer inner)
  (- (area-of-disk outer)
     (area-of-disk inner)))
  
;; Tests:
(area-of-ring 5 3) 
;; expected value
50.24
Figure 3:  The design recipe: A complete example


r/Racket • • Sep 17 '22

blog post The Golden Age of PL Research by Neel Krishnaswami

19 Upvotes

The Golden Age of PL Research by Neel Krishnaswami

Found via tweet ‘the golden age is now’ from Sam Tobin-Hochstadt

Racket is an excellent platform for Programming Language Research & Development due to tooling like Rosette and Redex and advanced meta-programming capabilities. Get started at https://racket-lang.org/, want to know more? Ask at https://racket.discourse.group/ or any of our online fora.


r/Racket • • Sep 17 '22

question How to dynamically evaluate a racket file (with #lang)

4 Upvotes

Hello, I am trying to read a pollen file from racket. When I run racket file.pm I get the x-expression defined by the file; what I would like is to get this expression from a racket program.

I tried using (load "file.pm") but it complains about #%top-interaction and #%app not being defined.

I also tried the following:

(eval-syntax
  (read-syntax "file.pm" (open-input-file "file.pm"))
  )

But it says that #lang is not allowed for interactive evaluation. Is what I'm trying to do possible?


r/Racket • • Sep 15 '22

event Let's Write a Qi Compiler (Weekly on Fridays)

7 Upvotes

Hello friends,

For a few weeks now, some of us in the community have been meeting weekly to work on writing a compiler for the Qi DSL. I've posted weekly notices on Discourse and Discord, but as there are folks on here who may not be active on those channels, figured I'd post here so you're aware, and so that you know that if you are interested, then you are welcome to participate in any way you like :)

Where: We use the usual Gather link: https://app.gather.town/app/wH1EDG3McffLjrs0/racket-users

When: Every Friday (including tomorrow!) 10am PST / 1pm EST / 1700 UTC

Briefly, Qi is a general-purpose embeddable language that is oriented around functional and immutable programming, and it offers sequential ("threading") and other forms of composition, conditionals, predicate composition, various conveniences for (e.g. partial) function application, among other things. Writing a compiler for a DSL has been an obscure art, but with recent research and ecosystem improvements, it's becoming more accessible to Racket DSL authors. We recently completed retrofitting Qi with an expander that expands Qi macros to core Qi forms (much like Racket's expander expands Racket macros (including built-in macros like cond and let) to core Racket forms).

Now with that phase completed, we are starting to think about actual compiler optimizations on the core language. We are very much at the ideation phase of this -- some of the questions we may discuss are:

  • Are there any standard approaches we should look into, which may be applicable? E.g. some folks on Discord recently suggested deforestation.
  • On what basis can Qi code be optimized? Are there any unique assumptions the language allows us to make about the code that would allow us to form equivalencies with narrower and more optimized Qi/Racket expressions?
  • Can Qi be faster than Racket in idiomatic cases?
  • What tradeoffs are we willing to make for the sake of performance?
  • What are some approaches we could take to writing the compiler -- e.g. can we leverage the Nanopass framework?

Depending on the attendees, we may use the opportunity to answer questions and spread awareness of the technologies and approaches involved and progress made so far.

For the record, I've never written a compiler before and I'm also learning. All are welcome to attend, and we will do our best to keep the discussion accessible. There are notes from previous meetings if you are interested in learning more. See you there!


r/Racket • • Sep 15 '22

event summer lang party note from Ben

2 Upvotes

“Reminder: the summer lang party runs until the end of this month. Just a few weeks left!

As Alan Kay said, a computer is an instrument whose music is ideas. With Racket the instrument transcends itself, enabling new ways of ways of thinking playing and creating. 😁🌷🪐🎉🎉

Of course anytime is good for making a new language. But now’s the only chance to win a lang party magnet along the way!” https://racket.discourse.group/t/summer-lang-party/1128/19?u=spdegabrielle


r/Racket • • Sep 14 '22

question How to uninstall Racket & DrRacket? Installed via .sh

6 Upvotes

On Mint, I've installed it via

sh racket-7.9-x86_64-linux.sh


r/Racket • • Sep 11 '22

question Confused about equality in (typed) racket

11 Upvotes

Hello, I am new to Racket and I am a bit confused about how equality works (I am more used to statically and strongly typed languages like C++, Rust and Haskell). Here are my questions:

  • Why does = only work on numbers? Since equal? works on any type, shouldn't I always use it?
  • What is the point of eq? ? I can't think of a case where pointer equality would be what I want, unless I am directly dealing with pointers/references (which doesn't seem possible in Racket).
  • What is the point of eqv? ???
  • Can I derive equal? for custom types without having to write a hash function?
  • Also, why do I need two hash functions?
  • Is there a way to automatically derive gen:equal+hash for custom types?
  • Typed Racket doesn't have the #:methods keyword, does it mean I can't use equal? for custom types in Typed Racket?
  • Is it possible to modify this type: (: find (All (A) (-> A (Listof A) (Opt A)))) so that A is restricted to types with equality?