Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
sklogic
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
43 ms
·
391.
▲
by
sklogic
11y ago
Not in Racket, but still a Lisp: https://github.com/combinatorylogic/mbase/tree/master/src/l/...
392.
▲
by
sklogic
11y ago
> What I want more than anything is a guide written on the same level on how to build a toy statically-typed language, with algebraic data types. The answers here might be useful: http://stackoverflow.com/questions/1
393.
▲
by
sklogic
11y ago
I just wonder if they'll ever stop confusing CS with a software engineering?
394.
▲
by
sklogic
11y ago
For everyone here who mentioned building wrappers around llvm-c or llvm c++ api: there is a nice tool for automating this job (and many other similar things), it's called "Clang". Or, more specifically, cindex. It's easy
395.
▲
by
sklogic
11y ago
Notepad? GUI? Are you kidding? Emacs was a GUI, Notepad is a joke of a GUI.
396.
▲
by
sklogic
11y ago
> "I find it pretty amazing that old-timey[1] 'programmers' fail to understand modern VM architecture" Especially given that they've been "modern" from around 1970s, not changing much since then (traci
397.
▲
by
sklogic
11y ago
Most modern FPGAs got two-port block rams. Ideal for stacks and FIFOs. Many non-trivial designs are using stacks one way or another.
398.
▲
by
sklogic
11y ago
That hipstor buzzword hardly deserves "THE" in front of it.
399.
▲
by
sklogic
11y ago
Mlkit is using region analysis to convert heap allocations to the stack allocations. Same with Harlan (it targets opencl, therefore no heap at all).
400.
▲
by
sklogic
11y ago
Many ISAs do not provide any specific stack handling instructions, and yet a C ABI is based on a stack model very similar to x86 one. Instructions are irrelevant, ABI is only a convention.
401.
▲
by
sklogic
11y ago
> which is one of the reasons I'd personally like to see a usable reflection land in C++. Of course. Reflection and proper macros. At least something like mbeddr would have been great. I never said preprocessor is the best possible
402.
▲
by
sklogic
11y ago
If you want a dense, readable, maintainable code - you're out of options, you have to resort to the preprocessor. Any kind of repeating lists (enum + a switch over all the values, for example) are best handled by define-include-undef
403.
▲
by
sklogic
11y ago
Of course. But, as I said, you don't have to restrict your macros, you only have to add a bit of a protocol on top of them in order to make them play nicely with all the tools. And then you'll get the most powerful programming
404.
▲
by
sklogic
11y ago
You have to use preprocessor in any non-trivial C++ project. For an idiomatic and very nice and clean example of a heavy preprocessor use see LLVM and Clang code.
405.
▲
by
sklogic
11y ago
If I understand it correctly, Cursive is something different, they don't want to run an inferior Clojure image (unlike Slime, for example), but reproducing a lot of Clojure functionality with their massively complex static analysis too
406.
▲
by
sklogic
11y ago
Why? You know which macro made the identifiers. You know what this macro consumed. In most practically important cases this is sufficient. But, yes, you cannot do it with the Common Lisp approach, where macros operate on bare lists, not
407.
▲
by
sklogic
11y ago
Actually I do have a such a framework [1], but this is not my point here. My point was that it's relatively trivial to implement such a collection of DSLs on top of pretty much any sufficiently powerful (i.e., CL-like macros) meta-lang
408.
▲
by
sklogic
11y ago
libclang is just an example, maybe not an ideal one. But, yes, I'm advocating for an executable language spec, one that you'd use as a (probably suboptimal, but canonical) implementation. A good example of such a thing would be
409.
▲
by
sklogic
11y ago
It is a broken approach. A much better way is to have a standard protocol (see slime for example, or IPython, or whatever else), and use the same tools as your compiler does, instead of reimplementing all the crap over and over again from t
410.
▲
by
sklogic
11y ago
IDE does not execute the macro - it knows the result of its expansion from the compiler. And compiler keeps a track of all the identifiers and their origins.
411.
▲
by
sklogic
11y ago
I am already slow-banned here (or whatever it is called). If I start spamming the links, they will suspend this account.
412.
▲
by
sklogic
11y ago
No. Tools do not know anything about the restrictions. In fact they work with a wide range of languages, not just lisp. The only "restriction" is a protocol, built into the macro expander, syntax frontend and compiler core. So, in
413.
▲
by
sklogic
11y ago
I was talking about the well designed DSLs. This should include a decent syntax.
414.
▲
by
sklogic
11y ago
> Most languages won't let you write mathematics exactly like mathematicians do, but the closer you can get the better See Wolfram Mathematica for example. Also, one of my usual DSL tricks is to allow arbitrary TeX in identifiers, w
415.
▲
by
sklogic
11y ago
Of course I can. If my tools are communicating with my compiler, they know everything it knows. I have a single tiny generic Emacs mode (and a similar Visual Studio extension) that handles all the languages designed on top of my extensi
416.
▲
by
sklogic
11y ago
> As the article states The article is plain wrong. > if every application has it's own language and syntax that is a huge barrier for others coming to work on it And this is quite obviously not true. A well designed (note the
417.
▲
by
sklogic
11y ago
I really hope that extensible languages are the future. It is unfortunate that a majority of their users had no clue on how to properly extend the languages. It's about a time to fixe it. > resulting code was so hard to read, DSL
418.
▲
by
sklogic
11y ago
Sorry, I did not quite get what you mean. Of course macro+syntax extension got absolutely nothing to do with what you can achieve in a language without macros. And, no, you did not understand. Any custom syntax you're adding (if the ri
419.
▲
by
sklogic
11y ago
I have a nice DSL which makes building complex type systems (including dependent) trivial and fun. So I do not mind adding typing to pretty much any kind of DSLs, including the smallest of them.
420.
▲
by
sklogic
11y ago
Yes you can - as soon as you start wrapping your arbitrarily complex macros into a custom syntax . I am easily doing this stuff with any language I am adding macros and extensible syntax to.
More ›