Skip to content

Instantly share code, notes, and snippets.

View lazywithclass's full-sized avatar

Alberto Zaccagni lazywithclass

View GitHub Profile
@lazywithclass
lazywithclass / blog-post.md
Last active April 24, 2017 23:38
[RC Diary] Interpreter and interviews(-36)

[RC Diary] Interpreter and interviews(-36)

Interpreter

Thanks to Racket I am getting even more understanding of how the interpreter works under the covers, especially (require racket/trace) is helping a lot, I can verify my assumptions with a quick run. This is basically what I wanted to do when I tried to translate the interpreter into Clojure, but couldn't because of my limited understanding of how to implement a patter match for lambdas.

Interviews

@lazywithclass
lazywithclass / interp.rkt
Last active April 24, 2017 21:48
Racket interpreter
#!/usr/bin/racket
#lang racket
;; https://www.cs.indiana.edu/cgi-pub/c311/lib/exe/fetch.php?media=pmatch.scm
;; pmatch included here ******************
(define-syntax pmatch
(syntax-rules ()
((_ v c ...) (pmatch-who #f v c ...))))
(define-syntax pmatch-who
@lazywithclass
lazywithclass / blog-post.md
Last active April 24, 2017 16:04
[RC Diary] Interpreter (-37)

[RC Diary] Interpreter (-37)

I am studying an interpreter written in Scheme and meanwhile writing a blog post about the experience.

@lazywithclass
lazywithclass / blog-post.md
Last active April 26, 2024 18:22
Looking at the most beautiful program ever written - part 1

Looking at the most beautiful program ever written - part 1

I am going to have a look at what William Byrd presented as The most beautiful program ever written.

Beauty here refers to computer programs, specifically about Lisp. There might be errors as this is something I wrote to make sense of that interpreter, proceed at your own risk.

Thanks a lot to Carl J. Factora for the help.

The program

@lazywithclass
lazywithclass / blog-post.md
Last active April 23, 2017 19:46
[RC Diary] Interviews, mock interviews, more mock interviews, and Dota (-39)

[RC Diary] Interviews, mock interviews, more mock interviews, and Dota (-39)

Real and fake. The more I attend interviews the more I realise how useless they are: sometimes it just feels like you have an hour with your interviewer and you have to fill it somehow with professional questions.

I am really getting lazy with these diary posts recently. Damn.

@lazywithclass
lazywithclass / blog-post.md
Created April 19, 2017 20:09
[RC Diary] Interview exercise (-42)

[RC Diary] Interview exercise (-42)

I find that being at a whiteboard completely changes my approach to the problem:

  • at the laptop I am like, yeh ok let's code this thing with the first thing that comes into my mind
  • at the whiteboard I am all like, uuhhhmmmmm, let's try this approach carefully and see what happens

I've spent most of the day going through this exercise, or better, through this last edge case of this exercise. Basically hackerrank.com runs your code against a set of tests, but it just tells you when you fail a test, without giving either inputs or outputs.

@lazywithclass
lazywithclass / blog-post.md
Created April 19, 2017 19:09
[RC Diary] Jobs hunt, climbing the Scala, and speed reading app (-43)

[RC Diary] Jobs hunt, climbing the Scala, and speed reading app (-43)

I'm getting close to my mental limit I think, I have less and less energy as time approaches the end of my batch.

@lazywithclass
lazywithclass / blog-post.md
Created April 17, 2017 14:31
[RC Diary] Scala (-45)
@lazywithclass
lazywithclass / blog-post.md
Last active April 17, 2017 14:29
[RC Diary] Scala (-45)