News for hackers. Stuff that matters.
Re:Racket v8.0 by brabel on Sunday February 14, 2021 @04:05AM (#26130761)
Congratulations! It's been a long time waiting!

I've wanted to develop desktop UIs that look professional and are lightweight, and I wonder if Racket, with its built-in UI framework, could be a good choice.

I did try it once but the hello world app was already really heavy (200MB of RAM instantly taken , if I remember correctly), but maybe I did something wrong (debug mode perhaps??)

Can I package a Racket app with a MacOS installer and sign it? How about Windows and Linux?

Re:Racket v8.0 by fileeditview on Sunday February 14, 2021 @04:49AM (#26130934)
I was/am in the same boat. A few months back someone recommended this blog to me: https://alex-hhh.github.io/

If you want to see some "real world" high quality Racket GUI stuff this is the place to go. Very inspiring. I'd love to do more with Racket & its GUI lib.

Re:Racket v8.0 by nmg on Sunday February 14, 2021 @07:23AM (#26131788)
WOW - in his space invaders example, his animated sprites are displayed in the REPL. So neat.
Re:Racket v8.0 by Decabytes on Sunday February 14, 2021 @08:49AM (#26132357)
I've been using Racket on the rpi3 (BC not chez as it's not in the repos yet) and the resource issue is exacerbated (as well as the start up times). I asked about reducing the start up time and resources load recently on the subreddit, but other than doing things like this below I've found nothing.

  #lang racket/base

  (require racket/draw pict racket/gui/base racket/class)

  ;; avoiding pulling in to many extra deps so have to redefine some useful functions
  (define (first lst)
    (car lst))

  (define (second lst)
    (cadr lst))

  (define (third lst)
    (caddr lst))


  (define (false? val)
    (not val))

If anyone cares the code is here https://gitlab.com/diegocrespo/imgmac/-/tree/master. For context this is a paint program that currently creates a 1024x748 window with a canvas, 31 buttons, and a file menu. It uses 280M of memory on my desktop running Manjaro, which isn't the greatest. In my testing, typed racket also increases the memory uses.

Thankfully after creating a basic frame and canvas, the jumps haven't been as big, but I could easily see the program going to 400M by the time it's done. I will download Racket 8.0 today and see how it performs

I think once Gerbil scheme becomes more mature I'll do more work in that. It's faster, smaller, and borrows a lot of things from Racket that I like.

*EDIT* I installed racket 8.0 (super easy and removed the old installation as well!) and compiled my program. Compiling it and running it results in it going from 280M down to 220M, That's a 27% improvement. Creating an exe brings the memory usage back to 243M but that's still down. I'm less familiar with creating exes so there might be some settings I can tweak.

Re:Racket v8.0 by cnasc on Sunday February 14, 2021 @06:42AM (#26131539)
Generally speaking, for smaller size you should use #lang racket/base and then only import the extras you need.
Re:Racket v8.0 by rscho on Sunday February 14, 2021 @05:40AM (#26131172)
I don't know the current memory consumption, but FWIW Racket recently improved on that front.

As for debug mode, you should AOT compile with 'raco make' to run a fair test.