Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
richard_shelton
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
richard_shelton
6mo ago
I am building educational 16-bit game console for low-cost FPGA chips. https://github.com/true-grue/Brus-16
2.
▲
Simple Python AST Visualizer
(github.com)
1 points
by
richard_shelton
1y ago
|
1 comments
3.
▲
by
richard_shelton
1y ago
A microlibrary in 52 LOC.
4.
▲
by
richard_shelton
1y ago
In some parallel world, Python is the perfect tool for language-oriented programming. Any decorated function is compiled by its own DSL compiler into the internal representation of the corresponding solver, and functions communicate with ea
5.
▲
by
richard_shelton
1y ago
Or you can use Python AST + Z3 :) Here is a toy implementation: https://github.com/true-grue/python-dsls/blob/main/datalog/d...
6.
▲
by
richard_shelton
2y ago
It's funny how close it is to the title of my talk "Python already has a frontend for your compiler": https://github.com/true-grue/python-dsls
7.
▲
by
richard_shelton
2y ago
I hope someone will write an article about Gary Kildall's achievements in theory of compilation. For us, compiler writers, he is a legendary figure.
8.
▲
by
richard_shelton
3y ago
What I like about these notes is that a complex topic is described in a simple and very practical manner. By the way, a few years ago there was another project on creating a code generator using declarative constraint solving: https:/
9.
▲
by
richard_shelton
3y ago
Here are more real-world, compiler-related examples: https://github.com/true-grue/python-dsls/blob/main/python_ds...
10.
▲
by
richard_shelton
4y ago
By the way, there is a similar work to Unison project. Its basic idea is to automate the compiler backend generation with help of SMT solver. The article: https://link.springer.com/epdf/10.1134/S0361768821070082?sh
11.
▲
Development a SMT solver-based code generator for specialized processors
(rdcu.be)
1 points
by
richard_shelton
4y ago
|
0 comments
12.
▲
by
richard_shelton
5y ago
Basically, yes, so I tried to make a simple implementation as possible. And I'm taking into account that students are already familiar with postfix notation and stack data structure. Of course, I use additional sources (like the popula
13.
▲
by
richard_shelton
5y ago
If you are familiar with Forth, Postscript, or Joy you should have no problems with programming in Fortik :) Still, the idea of Fortik is to encourage students to learn how simple interpreters work and to extend the language.
14.
▲
Tiny stack-based language implementation (61 sloc, Python)
(github.com)
2 points
by
richard_shelton
5y ago
|
4 comments
15.
▲
Tiny (51 sloc) SQL-like database query interpreter written in Python
(github.com)
1 points
by
richard_shelton
5y ago
|
0 comments
16.
▲
by
richard_shelton
6y ago
The chip is closer to AsAP [1] and XMOS xCore [2]. I remember that these two chips-competitors already existed when I was programming the predecessor of Greenarrays GA144. By the way, it was very fun to program these Forth-based processor a
17.
▲
by
richard_shelton
7y ago
Sure, my code is only a demonstration that you can fit everything in <100 lines. I remember that there were some sceptics in older HN discussions on this topic... :) Again, thank you very much for all your education reverse engineering
18.
▲
by
richard_shelton
7y ago
Here is my simple port of VoxelSpace (74 sloc). Written in Python 3, no additional libraries required. https://github.com/true-grue/terrain Looks like Python+Tkinter is a good demoscene platform where you have performa
19.
▲
by
richard_shelton
7y ago
About Warren's article. I just returned it back, sorry for the inconvenience :) By the way, you may find basically the same description of the compiler in The Art of Prolog book.
20.
▲
Tiny Python lib for using yEd as an alternative to Graphviz
(github.com)
6 points
by
richard_shelton
7y ago
|
0 comments
21.
▲
by
richard_shelton
8y ago
And here is an another pattern matching implementation for Python [1]. It was made for compilers construction task and may look similiar for those who has an experience with Prolog, Stratego or Refal. And here is a toy term rewriting system
22.
▲
by
richard_shelton
8y ago
Thank you, really interesting reading! It would be interesting to see how this rule ("x = (y + c1) + c2 => x = y + (с1 + с2)") was encoded in the compiler. I guess it has more complicated form than a (simple and declarative) te
23.
▲
by
richard_shelton
8y ago
I think there definitely is some similarity between Kuryokhin and Zoshchenko. "Stories about Lenin" by M. Zoshchenko have some absurd/satire elements. And these elements were almost invisible for many Soviet citizens. They st
24.
▲
by
richard_shelton
8y ago
You almost made me think that "Wag the Dog" is a Russian movie [1]. [1] https://en.wikipedia.org/wiki/Wag_the_Dog
25.
▲
Tools for rapid prototyping of DSL compilers (in Python)
(github.com)
1 points
by
richard_shelton
8y ago
|
0 comments
26.
▲
by
richard_shelton
8y ago
Thank you very much! I decided to place my DSL tools (they contain a tiny amount of code, but I've used them successfully in a number of compiler projects) on github and just started looking for some illustrative examples. And your sol
27.
▲
by
richard_shelton
8y ago
In a general sense, yes, of course. Here are more examples. 1. BNF notation. Yes, it could be surprising, but in a BNF-like language we use function-level representation and white spaces here denote sequential composition of functions -- no
28.
▲
by
richard_shelton
8y ago
So called concatenative language is also a combinator-oriented language in a somewhat restricted form. Here are some historic examples of combinator-oriented languages: APL family and Backus's FP/FL (direct inspiration for the aut
29.
▲
by
richard_shelton
8y ago
it's interesting to mention that both Alan Kay (see "The early history of Smalltalk") and John McCarthy (see "advice taker") have very high opinion of logic programming. Thanks for showing your code! I just placed m
30.
▲
by
richard_shelton
8y ago
Thanks for the link! There is a good reason for using Prolog-like language in a compiler-related project. Prolog was used for rapid prototyping of compilers since the end of 70s and it's still ahead of the time. And if you take a look
More ›