Keeping my mind sharp

93 views
Skip to first unread message

Josh Rubin

unread,
May 11, 2019, 10:15:56 AM5/11/19
to Racket Users
Some people in their 60's do crossword puzzles to keep their mind sharp. I want to return to compiler hacking. I have experience with the ideas and code from many old compilers - MIT MacLisp and Rabbit (the grandfather of all Schemes), David Betz's Xscheme (shout out!), Texas Instruments Scheme. My 1980's home-brew byte-code compiler passed compliance tests and ran large existing Scheme programs. PLT Scheme existed but I never used it.

I want to run some of my old code and learn Racket at the same time. There will be problems: my declining technical chops, defmacro, and name collisions. I haven't programmed in many years.
I haven't even written Hello World for Racket yet. I must be a fool.

Is it feasible to use Racket to create an environment for my old scheme code?

What forums/mailing-lists should I join? Will Google Groups continue to exist?

I welcome any tips you might have.

John Clements

unread,
May 11, 2019, 1:04:08 PM5/11/19
to Josh Rubin, Racket Users


> On May 11, 2019, at 07:15, Josh Rubin <jlr...@gmail.com> wrote:
>
> Some people in their 60's do crossword puzzles to keep their mind sharp. I want to return to compiler hacking. I have experience with the ideas and code from many old compilers - MIT MacLisp and Rabbit (the grandfather of all Schemes), David Betz's Xscheme (shout out!), Texas Instruments Scheme. My 1980's home-brew byte-code compiler passed compliance tests and ran large existing Scheme programs. PLT Scheme existed but I never used it.

Welcome!
>
> I want to run some of my old code and learn Racket at the same time. There will be problems: my declining technical chops, defmacro, and name collisions. I haven't programmed in many years. I haven't even written Hello World for Racket yet. I must be a fool.

Doubtful!

>
> Is it feasible to use Racket to create an environment for my old scheme code?

Yes!
>
> What forums/mailing-lists should I join? Will Google Groups continue to exist?

This one!
>
> I welcome any tips you might have.

Ah, now there you’ve got me. Oh here’s one: come to RacketCon?


John Clements

Josh Rubin

unread,
May 11, 2019, 2:27:07 PM5/11/19
to Racket Users


On Saturday, May 11, 2019 at 10:15:56 AM UTC-4, Josh Rubin wrote:
<SNIPPED MY ENTIRE POST>

I apologize for replying to myself.

They say "Hello World" is the hardest program, because you have to stumble so much.
Without reading any documentation I put some plausible stuff in a text file. I now have a 13 MB executable that can be distributed and prints "Hello World."

I have questions.
(1) Should I be trying to *port* old Scheme code to Racket (a big job) or should I be *creating a language* that mostly runs the old code as is?

(2) Should I record all my false starts and confusions in a blog called "An old man tries to learn Racket"?
Might interest struggling racketeers, or people who try to teach them.

Disgruntled Kangaroo

unread,
May 11, 2019, 3:24:38 PM5/11/19
to Racket Users
On Sat, May 11, 2019 at 11:27:06AM -0700, Josh Rubin wrote:
>
>
> On Saturday, May 11, 2019 at 10:15:56 AM UTC-4, Josh Rubin wrote:
> <SNIPPED MY ENTIRE POST>
>
> I apologize for replying to myself.
>
> They say "Hello World" is the hardest program, because you have to stumble
> so much.
> Without reading any documentation I put some plausible stuff in a text
> file. I now have a 13 MB executable that can be distributed and prints
> "Hello World."
>
> I have questions.
> (1) Should I be trying to *port* old Scheme code to Racket (a big job) or
> should I be *creating a language* that mostly runs the old code as is?

Honestly, I think I'd try both. If your trying to get back into coding,
porting one program over and trying to write a new language for the other(s)
may well teach you things taking one approach over the other wouldn't have.
YMMV, of course.

>
> (2) Should I record all my false starts and confusions in a blog called "An
> old man tries to learn Racket"?
> Might interest struggling racketeers, or people who try to teach them.

I'd read it.


Greg Hendershott

unread,
May 11, 2019, 3:40:50 PM5/11/19
to Josh Rubin, Racket Users

Others will have better advice, but a few thoughts:

Josh Rubin <jlr...@gmail.com> writes:
> I have questions.
> (1) Should I be trying to *port* old Scheme code to Racket (a big job) or
> should I be *creating a language* that mostly runs the old code as is?

As an early "warm-up" step, maybe try to port some small chunk(s) of
your old Scheme code to Racket, by hand? You'll start to learn some of
the issues -- get a feel for what might be involved if you were to port
the rest by hand, or, depend more on "adapter" code, or, even create a
full #lang.

To attempt the last of these right off the bat, might be overwhelming?
It would be, to me. But I guess it depends on your learning style. Also
it depends whether you like to work more "top down" vs. "bottom up".

People who know older Scheme dialects better than me might have
more-specific tips.

> (2) Should I record all my false starts and confusions in a blog called "An
> old man tries to learn Racket"?
> Might interest struggling racketeers, or people who try to teach them.

That would be great!

Idea: The cool kids these days tend to create an account on GitHub or
GitLab. That way, other folks can see the code and more easily offer
advice. Plus, the commit history is itself a story about your journey
doing this. The commit messages can even be sort of mini blog posts,
draft material for real blog posts.

Greg Hendershott

unread,
May 11, 2019, 4:05:24 PM5/11/19
to Josh Rubin, Racket Users

Greg Hendershott <rac...@greghendershott.com> writes:
> Idea: The cool kids these days tend to create an account on GitHub or
> GitLab. That way, other folks can see the code and more easily offer
> advice. Plus, the commit history is itself a story about your journey
> doing this. The commit messages can even be sort of mini blog posts,
> draft material for real blog posts.

To expand on this. I mostly wrote Turbo Pascal and C code in the 80s.
Today I mostly write Racket. Going from C/Pascal to Racket, is a big
change. :)

But also important: In the 80s I mostly didn't use version control. (In
the 90s, I mostly used version control systems that mostly were awful.)

So: Git is also a change. A big change. At least for me. I commit early
and often. It's a way to leave a trail of breadcrumbs. What was I
thinking? How the heck did I get here? How can I back up and get out?
You could think of it as a kind of persistent undo system. (Plus it can
be an undo _tree_: You can quickly/cheaply make branches to explore
different approaches, in parallel.)

That change may or may not be something that you want to embrace. I just
wanted to clarify that using Git{Hub Lab} as a kind of "coding social
network" is only part of the story when it comes to Git.

Josh Rubin

unread,
May 11, 2019, 8:41:13 PM5/11/19
to Racket Users

This is going to be easier than I thought. Nobody told me (mostly-equal? Racket Scheme)

Racket seems to be a superset of the Scheme I know, with more restrictions on mutation. I was conservative about mutations. My worst habit was using "reverse!" and "append!". They are used in stereotypical ways or hidden behind a layer of data abstraction, so they won't cause trouble. I need to box some stuff. Many of the things I used macros for are now natively supported. Old style macros are still there until I learn the shiny new hygienic macros.

I have to relearn the programming environment - editing, debugging, and packaging. I want to know what is underneath the surface. As someone told me, I really should learn git.

--
Josh Rubin
jlr...@gmail.com


Matthias Felleisen

unread,
May 11, 2019, 8:58:07 PM5/11/19
to Josh Rubin, Racket Users
Josh, 

as the old guy on the Racket team, welcome to our world. I am so old, I was almost on the Texas Instrument Scheme team :) As you discovered Racket is a descendant of Scheme. I’d like to use the phrase it is Scheme’s heir but that would mean Scheme is daed, but the species of cockroach doesn't die out. 

As several people mentioned, you want to 

— port some sample programs from your 1980s TI Scheme days to Racket 
— .. other than the removal of mutable lists that will work. 

Let me recommend a second step. Find some of the modern features of Racket to make the code Racket-y. That’s what we call it when code uses the most basic Racket ideas: 

— use modules to split your code into comprehensive units, use nested defines, mingle them with expressions 
— if you touched CLOS, we have a class system with mixins 
— trade map for for/list and friends (https://docs.racket-lang.org/reference/for.html?q=for%2Flist); loops that don’t need set! 

The third step would be to design a language that makes your programs “just run”, because Racket’s major trick is “language-oriented programming”. 

One step on the way to #lang’s is to re-learn macros. Texas Instruments dabbled with Kohlbecker’s hygienic macros but don’t be confused about two different things that got conflated back then: 

— macros that get lexical scope right for you while you don’t have to think about most of the time 
— macros that use pattern-matching facilities to check basic properties of the surface 

Once you have basic macros down, you will climb the hill to macro design patterns. But I am sure we will hear from you before that, and as you can tell, people will help out 

— Matthias

 



Reply all
Reply to author
Forward
0 new messages