135 karma · joined May 16, 2016 (10y ago) · 46 submissions
comment 6y ago · link · parent
Are you a programming language nerd? Are you interested in compilers and interpreters? Have you always liked them, but felt apprehensive about actually implementing one yourself?
A few years ago, I had the privilege of teaching a graduate course with Mario Wolczko at the University of California, Berkeley on programming languages and compilers. In the course, we teach you how to implement a non-trivial programming language, starting with a basic abstract syntax tree interpreter, and ending with a just-in-time compiler.
I just posted our course exercises to my website, which walks you through how to implement the programming language from scratch.
Cheers, Patrick
P.S. And if you find that you enjoy this sort of thing, consider working with us at JITX (www.jitx.com) on automating circuit board design. We designed a programming language for making circuit boards!
2.
Implement a Just-in-Time Compiler from Scratch(patricksli.com ↗)
1 points · by patricksli · 6y ago · 1 comment
comment 8y ago · link · parent
We have an internal scoreboard that tracks how much of each job we successfully automate, and we steadily improve our algorithms to make progress on that.
comment 8y ago · link · parent
We plan to replace most of the needs for prototyping. But there is still about a 3-4 day turn to get your boards back from the fab.
If you have all the parts already lying around, and a breadboard handy, then you could get a breadboard design up faster than you could with our service.
We have Wyisywig tools internally for help during placing / inspecting the board shapes / verifying package footprints etc.
comment 8y ago · link · parent
For JITX, we're using a language called Stanza, which provides decorated s-expressions out of the box. It's basically still just s-expressions, but it looks prettier.
comment 8y ago · link · parent
When we were teaching an electronics design course at Berkeley, we were lucky to have a couple of desktop mills handy.
When we coupled JitPCB with the mills, we could completely sidestep the need for breadboards completely, even during prototyping. We went from code to fabbed board in half an hour.
comment 8y ago · link · parent
comment 9y ago · link · parent
What you're describing is, I believe, one particular strategy among many with the goal of allowing users to gradually add type annotations. The goal itself is not new, and is often called optional-typing. The two words "gradual typing" specifically is also one particular strategy for optional typing but is under the ownership of Jeremy since he coined it. Informally, people do seem to use the term in a looser way.
comment 9y ago · link · parent
Thank you for the link though. I will see how the term is used colloquially nowadays.
13.
The Design of Stanza's Optional Type System(lbstanza.org ↗)
32 points · by patricksli · 9y ago · 19 comments
comment 9y ago · link · parent
Since there's been interest in the D-expressions paper, I wanted to add that Jonathan Bachrach (the first author on the paper) is actually my Ph.D. advisor, and we just released a new programming language a few months ago called Stanza based on similar ideas. Stanza is a spiritual successor to Dylan of sorts: it has an optional type system, coroutines, a multimethod-based object system, programmatic macros, and an s-expression-based natural syntax. You can check it out at www.lbstanza.org.
- Patrick15.
The Design of Stanza's Optional Type System(lbstanza.org ↗)
2 points · by patricksli · 10y ago · discuss
16.
“Stop Designing Languages. Write Libraries Instead.”(lbstanza.org ↗)
41 points · by patricksli · 10y ago · 5 comments
comment 10y ago · link · parent
Stanza is a new optionally-typed general purpose programming language from U.C. Berkeley. If you're interested, see our original posting at https://news.ycombinator.com/item?id=11717561.
18.
Stanza Programming Language Now Supports Windows(lbstanza.org ↗)
1 points · by patricksli · 10y ago · 1 comment
comment 10y ago · link · parent
comment 10y ago · link · parent
The standard library currently only provides basic IO, primitive types and collections. We will be attaching a gui library, opengl library, networking library, and regex library soon.
comment 10y ago · link · parent
There are just some theoretical hurdles to solve in order to detect them properly in the presence of parametric types. That's been recently solved (though not by us) so we'll be implementing their solution soon.
comment 10y ago · link · parent
I mostly write software that is end-user-facing and interactive, with requirements that aren't known at the beginning of the project. Software that my mother would use, is how I typically describe them. e.g. Word processors, games, calendars, photo albums, spreadsheets, maps, movie players, etc.
And what I saw repeatedly, for all of my projects, was that progress comes a lot faster in the beginning than near the end. Eventually, I pinpointed the problem to one of software architecture. It is easy to see the required architecture for the start of a project, and making progress is easy. As you pile on demands and features, you realize that the architecture that you started off with is wrong, and progress slows. This is especially true if the requirements of your program are not known in advance. I expect people that mostly program well-known and stable algorithms don't have as much difficulty with this. E.g. numerical linear algebra, schedulers, image filters, etc. That is not what I write.
Once you realize that your architecture is wrong, you have two choices. You can either plow ahead with a sub-optimal architecture, and take a small but continual productivity hit. Or you can try to refactor and correct the architecture, and take a large one-time productivity hit. Neither approach is satisfactory. Small continual productivity hits eventually add up to the point that forward progress is seriously impeded. Refactoring also costs a lot of time, and eventually the cost of refactoring becomes too great to be worth it, and you're stuck with the last good enough architecture that existed.
So Stanza was designed to make it possible for me to : 1. Experiment easily without specifying upfront the class inheritance tree in the program. 2. Delay committing to a specific architecture for as long as possible. 3. Refactor the underlying architecture of a program through small local changes.
And for the programs that I write, I sincerely believe that I succeeded. I've been programming exclusively in Stanza for about three years now, and I haven't yet ran into the dreaded "refactor-or-abort" situations that arise often in Java/C++ programming. Radical changes to the underlying architecture of a program are possible by applying a series of small staged local changes. And the optional type system allows me to get a lot of features working without having to commit to an architecture, so that when I finally sit down to properly design the architecture it is much more likely to be correct.
So my ultimate goal with Stanza is to help you achieve a linear rate of progress across the project timeline. You should feel as productive near the end of the project as you did in the beginning of the project.
comment 10y ago · link · parent
Very intentionally, we called Stanza an "optionally-typed" language instead of a "gradually-typed" language. The moniker "gradual typing" was coined by Jeremy Siek and implies a very specific semantics and implementation style. One of the drawbacks of gradual typing is that obtaining good performance can be tricky.
Stanza does not use the same system, and we are not seeing the same problems. But the experiments and paper are still in progress.