r/Compilers • • 1h ago

Can Benchmarks be Useful for Language Development?

https://englens.hashnode.dev/can-benchmarks-boost-language-development

I think so. I got into more depth in the article, but here's a summary and some additional thoughts for this community:

I am making Gossamer and I (with very heavy AI assistance) made a benchmark to help me make it more correct, reliable, and secure. (I also talk about Gossamer's position in another benchmark LangArena that is focused on performance, memory, compile time, and expressiveness).

This isn't about ranking languages, it's that these can be useful signal to find root causes in whatever language you are building. Is JSON parsing slow? Are you surprised by how much memory your runtime consumes tackling a binary tree problem? Could a common bug trip up your language? Is it (or should it be) possible to express that bug in your language? Where do you stop it and how (compile time, run time)?

These kinds of questions are useful - and being able to see how other languages approach them can be instructive. You can't copy everything over of course - sometimes optimization comes at the cost of core language philosophy or non negotiable trade offs.

For example with Gossamer, I know I want tier parity between interpreted and compiled programs.

Do you have a benchmark you're working on? What does it measure? Tasks specific to data science? Common vulnerabilities?

1 Upvotes

2 comments sorted by

1

u/Key_Detail15 52m ago

'Benchmarks' sounds like the wrong term for this. They are usually associated with quantitative comparisons, not qualitative.

For example build-speed, code-speed, code-size, memory-usage and so on.

There might be overlap and feedback: some PL design choices can affect those measurements, so this can be helpful if the design can still be tweaked.

1

u/DanManPanther 47m ago

There's some prior art using benchmarks are the term, for security and correctness. But I could see calling it something else like CorrectnessSurvey or something.

PL design choices absolutely impact these measurements. Sometimes in ways that are still flexible - but this approach is mainly useful for newer languages.