Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
zmonx
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
1.
▲
Schedulebot: Simple Scheduling in Braid
(github.com)
1 points
by
zmonx
9y ago
|
0 comments
2.
▲
by
zmonx
9y ago
Whatever it does, I expect Emacs to not crash . If it cannot allocate more memory, I expect it to throw a Lisp exception that tells me so, not to crash the whole process. I greatly appreciate Daniel's work to increase the robustness
3.
▲
by
zmonx
9y ago
You can crash Emacs for example with the recipe from #2099: $ emacs -Q --eval "(let (v) (while t (setq v (cons v v))))" In response to how such deep structures can arise: They may for example arise when testing Emacs wit
4.
▲
The Warren Abstract Machine in Rust
(github.com)
2 points
by
zmonx
9y ago
|
0 comments
5.
▲
by
zmonx
9y ago
These are very good points! I would generalize "functional" to declarative though: Logic programming languages like Prolog and Mercury are also much more amenable to parallelization than C-like languages. In fact, different Prol
6.
▲
by
zmonx
9y ago
Prolog has definite clause grammars (DCGs), which are very similar to monads. You can think of a DCG as giving you two implicit arguments, which you can use to express concatenations and in fact arbitrary relations between states. There
7.
▲
by
zmonx
9y ago
Yes, indeed! Please note that what makes this reasoning method so easily applicable in this case is uniformity of the abstract syntax, not of the surface syntax, which is also called concrete syntax. Homoiconicity is a relation betwee
8.
▲
by
zmonx
9y ago
For one particular example where homoiconicity makes reasoning about programs easier, consider an important reasoning method called abstract interpretation : https://en.wikipedia.org/wiki/Abstract_interpretation Usi
9.
▲
by
zmonx
9y ago
Please note that the creators of Julia no longer call it homoiconic [1]. The fact that you can access the AST in a language is not sufficient to make it homoiconic. There are several programming languages like Julia that let you access
10.
▲
by
zmonx
9y ago
In my experience, that is an overgeneralization, though definitely a tempting one that is frequently encountered. That being said, I find that Prolog code is often more readable than Lisp code. An important reason for this is that Prolog su
11.
▲
by
zmonx
9y ago
To distinguish homoiconic languages from others (where you may also "operate on the parse tree just the same as you can on regular program data"), a bit more qualification is needed though. For example, in typical cases, reasoning
12.
▲
by
zmonx
9y ago
In my opinion, this article puts too much emphasis on reading , and too little emphasis on actually reasoning about programs in homoiconic languages like Prolog and Lisp, and due to this imbalance the conclusion is not sufficiently justi
13.
▲
by
zmonx
9y ago
Yes, very much so. In addition, some of the automated translators I have seen also apply automated refactoring: They tend to merge similar sections of code and minimize the delta (similar to diff ) that is factored out. This can create a m
14.
▲
by
zmonx
9y ago
Although it may appear a bit surprising at first, assembly language is homoiconic in the sense that you can easily reason about the program code within the language: It is easy to reason about bytes in assembler language, and compiled ass
15.
▲
by
zmonx
9y ago
I agree, and recommend Biomake: https://github.com/evoldoers/biomake It uses the declarative programming language Prolog to write flexible rules. A logic programming language like Prolog is very well suited for expre
16.
▲
by
zmonx
9y ago
Very nice, thank you for sharing! I have one comment on the naming convention. Consider has_type/3 from the post. For example: has_type(_, true, bool). A better name for this would be: term_type(_, true, bool). or eve
17.
▲
by
zmonx
9y ago
The reason for this apparent discrepancy is found in the difference between strong and weak NP-completeness. The fully polynomial-time approximation scheme (FPTAS) for the knapsack problem only runs in so-called pseudo-polynomial time: h
18.
▲
by
zmonx
9y ago
The authors have built a start-up based on these ideas: http://memcpu.com/ They provide their SAT solver as a service that you can try. A related paper I recommend in this context is NP-complete Problems and Physical Reali
19.
▲
by
zmonx
9y ago
This title is misleading: This was formulated as a question that was put forward (verbatim text: "Is a blockchain essentially a linked list?"), and the current answers are already now diverging between "Not at all!" an
20.
▲
by
zmonx
9y ago
Very nice, thank you for posting this! Program slicing is especially useful when debugging and reasoning about programs in declarative languages, such as Prolog. In Prolog, it is natural to think in terms of generalizations and specializa
21.
▲
by
zmonx
9y ago
25 years for acceptance are very well aligned with the timeline that Richard P. Gabriel has outlined in "Models of Software Acceptance": • Technology in the lab (t=0) • Technology in the first company (t=2–10 years post-lab) • Tec
22.
▲
by
zmonx
9y ago
Thank you for sharing this! It's nice to see Prolog used for such tasks, which are a good fit for a logic programming language. I have one small suggestion that I hope you find useful: Currently, the code is rather imperative : It con
23.
▲
by
zmonx
9y ago
The beauty of this is that a constraint solver (over finite domains, Boolean values, sets etc.) blends in completely seamlessly into the way Prolog works. From the perspective of Prolog and its users, a constraint solver is simply availab
24.
▲
by
zmonx
9y ago
Please see my profile page: It contains links that I find relevant for learning modern Prolog features. Every predicate you impose on the set of solutions can be regarded as a constraint , because it can at most restrict the set of solut
25.
▲
by
zmonx
9y ago
In fact, the "old semantics" actually included language constructs that are only now becoming available (again) in Prolog systems. An example of such a construct is dif/2, which is a constraint that was provided in even the
26.
▲
by
zmonx
9y ago
In a sense, yes, these modules are written in Prolog. However, that is not the full story: CLP requires special interface predicates that the underlying Prolog system must provide. You cannot implement CLP "on top" of just any Pro
27.
▲
by
zmonx
9y ago
I agree with what Sylvain Soliman said about this on Reddit: It's a nice tutorial for the 80's parts of the language: https://www.reddit.com/r/programming/comments/7hp2xw/introdu... In modern P
28.
▲
by
zmonx
9y ago
Sorting and then summing is a commonly used technique. Still, there are also better methods such as Kahan summation: https://en.wikipedia.org/wiki/Kahan_summation_algorithm Using pairwise addition is a very good alte
29.
▲
by
zmonx
9y ago
Yes, that is true.
30.
▲
by
zmonx
9y ago
It is true that cancellation errors are often the source of wrong results. However, computations involving IEEE floating point arithmetic can go horribly wrong even if there is no addition and no subtraction whatsoever, no divisions, and on
More ›