News for hackers. Stuff that matters.

Ask HN: Good performant language for handwritten code?

I'm planning a project where I want to write my code with pencil and paper.

However, the goal is to create working, robust software. It needs to actually run on computers, so I'll periodically transcribe to digital form. The deploy target is servers. Let's say one of the common VM types available on AWS.

Therefore, I'm trying to identify languages that are fast but fairly concise. For example, Ruby or Python would be good handwriting options, but they have slower execution speed. Rust and Java are fast, but verbose to write.

I'm thinking JS, Clojure, or Crystal might be the most practical choices. Any other suggestions?

( 6 comments | on HN )
Re:Ask HN: Good performant language for handwritten code? by gus_massa on Thursday November 09, 2023 @05:13PM (#38212124)
Python with numba and @jit is quite fast https://numba.readthedocs.io/en/stable/user/jit.html but you need to know how to use it. (I don't know, but one of my coworkers does.)

There is a nice comparison of languages speed and sizes in https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

I like Racket, but editing it without the help of a editor to match the parenthesis is imposible.

Re:Ask HN: Good performant language for handwritten code? by turboat on Thursday November 09, 2023 @05:47PM (#38212477)
Well, the parentheses don't necessarily have to be perfect on the paper :) I can fix them once it's on a computer.

That said, some manual tricks that could help: my former colleague had a simple trick of counting up with his fingers for open-parens, and then back down for close-parens.

I could also imagine using more line breaks and indentation to help keep the parens straight. It might be ugly, but on paper that formatting is only to support my thinking, it does not also need to cater to the committed source code.

Re:Ask HN: Good performant language for handwritten code? by gus_massa on Friday November 10, 2023 @07:47PM (#38226456)
Try numba and @jit first.

(Warning: After starting writing code in Racket (or Scheme/Lisp/Clojure...) you will start to obsess about matched parenthesis, even in paper https://xkcd.com/859/

Re:Ask HN: Good performant language for handwritten code? by 082349872349872 on Thursday November 09, 2023 @05:47PM (#38212484)
The APLs are tough to beat for high latency input mechanisms.

(Fun fact: Peter Landin originally introduced the "offside rule" because it would be suitable for handwritten as well as digital input)

Re:Ask HN: Good performant language for handwritten code? by enduku on Friday November 10, 2023 @10:24AM (#38219980)
I find myself using J [0] for such type of ideation/programming exercises. Klong/K/APL also lend to similar productivity.

[0] https://www.hillelwayne.com/handwriting-j/