Show HN: Writing an HTTP server in Prolog
41–50 of 74 posts
Re: Show HN: Writing an HTTP server in Prolog
#42Earlier quoted context omitted.
A very interesting aspect of Prolog is how its primary primitive is backtracking search. This is orders of magnitude more complex than C-language style primary primitives which closely match single machine instructions. Or even slightly more complex models in lazy languages like Haskell. It's strange that you can build a language almost purely off of graph search yet have it be generally useful. Makes you wonder what…
There's at least one language (Refal: there may be more!) based on Markov algorithms. Another language (XL: as far as I know this is the only one of its breed thus far) works at its core on parse tree substitution. Yet another (CHR) does a weird generalization of term re-writing to provide a toolkit for making constraint languages. (Yes, a language to make languages.) There's a reason I've become a programming langua…
Are there any other languages that are mainly designed with the goal of making it easier to make other general-purpose languages (as opposed to languages for DSLs or parser generation etc.)?
I know that generally many languages are written in C or compile to C, and that Lisp can also be used to make other languages or sub-languages.
But asking about languages (mostly) dedicated for that purpose - creation of new general-purpose programming languages.
Re: Show HN: Writing an HTTP server in Prolog
#43.pl is perl, use .pg for prolog
So nobody pays attention to that rule anyway.
I do get slightly confused switching between #perl and ##prolog on freenode sometimes, but the other regulars just laugh at me and we move on ;)
Re: Show HN: Writing an HTTP server in Prolog
#44Earlier quoted context omitted.
There's at least one language (Refal: there may be more!) based on Markov algorithms. Another language (XL: as far as I know this is the only one of its breed thus far) works at its core on parse tree substitution. Yet another (CHR) does a weird generalization of term re-writing to provide a toolkit for making constraint languages. (Yes, a language to make languages.) There's a reason I've become a programming langua…
>(Yes, a language to make languages.) Are there any other languages that are mainly designed with the goal of making it easier to make other general-purpose languages (as opposed to languages for DSLs or parser generation etc.)? I know that generally many languages are written in C or compile to C, and that Lisp can also be used to make other languages or sub-languages. But asking about languages (mostly) dedicated f…
Re: Show HN: Writing an HTTP server in Prolog
#45Re: Show HN: Writing an HTTP server in Prolog
#46Earlier quoted context omitted.
There's at least one language (Refal: there may be more!) based on Markov algorithms. Another language (XL: as far as I know this is the only one of its breed thus far) works at its core on parse tree substitution. Yet another (CHR) does a weird generalization of term re-writing to provide a toolkit for making constraint languages. (Yes, a language to make languages.) There's a reason I've become a programming langua…
>(Yes, a language to make languages.) Are there any other languages that are mainly designed with the goal of making it easier to make other general-purpose languages (as opposed to languages for DSLs or parser generation etc.)? I know that generally many languages are written in C or compile to C, and that Lisp can also be used to make other languages or sub-languages. But asking about languages (mostly) dedicated f…
Re: Show HN: Writing an HTTP server in Prolog
#47James, check out Mercury next as it's a faster, better Prolog with some industrial use. https://mercurylang.org
Last time I looked (admittedly years ago), it wasn't an unambiguously "better Prolog", because Mercury's static mode system couldn't capture all of what Prolog can do with unification.
Re: Show HN: Writing an HTTP server in Prolog
#48Earlier quoted context omitted.
Last time I looked (admittedly years ago), it wasn't an unambiguously "better Prolog", because Mercury's static mode system couldn't capture all of what Prolog can do with unification.
I'm repeating what most users told me. This is a new one on me. Care to elaborate?
For example, this code:
L = [_,_,_], maplist(p, L)
enumerates all three-element lists whose members satisfy the predicate p. This technique is impossible in Mercury because it does not allow terms with holes.Of course you can still compute the same result in Mercury, but you will have to do more work: I think you would have to write a specialized predicate instead of using a higher-order predicate from the library.
Re: Show HN: Writing an HTTP server in Prolog
#49Earlier quoted context omitted.
There's at least one language (Refal: there may be more!) based on Markov algorithms. Another language (XL: as far as I know this is the only one of its breed thus far) works at its core on parse tree substitution. Yet another (CHR) does a weird generalization of term re-writing to provide a toolkit for making constraint languages. (Yes, a language to make languages.) There's a reason I've become a programming langua…
>(Yes, a language to make languages.) Are there any other languages that are mainly designed with the goal of making it easier to make other general-purpose languages (as opposed to languages for DSLs or parser generation etc.)? I know that generally many languages are written in C or compile to C, and that Lisp can also be used to make other languages or sub-languages. But asking about languages (mostly) dedicated f…
That said, the parent's claim about CHR is rather broad, and you may have read too much into it. It's a library for writing new constraint programming libraries for Prolog. Combined with operator overloading, you get embedded DSLs for constraint systems. That's great, and it is "language development" in some sense. But CHR is not a tool for implementing interpreters or compilers for new programming languages (though it may be useful for some subtasks).
Re: Show HN: Writing an HTTP server in Prolog
#50Earlier quoted context omitted.
>(Yes, a language to make languages.) Are there any other languages that are mainly designed with the goal of making it easier to make other general-purpose languages (as opposed to languages for DSLs or parser generation etc.)? I know that generally many languages are written in C or compile to C, and that Lisp can also be used to make other languages or sub-languages. But asking about languages (mostly) dedicated f…
The K framework: http://www.kframework.org/index.php/Main_Page It's a system for formally expressing the semantics of programming languages and getting an interpreter. That said, the parent's claim about CHR is rather broad, and you may have read too much into it. It's a library for writing new constraint programming libraries for Prolog. Combined with operator overloading, you get embedded DSLs for constraint system…
Interesting about the K framework, thanks. Will take a look. That's the sort of thing I was asking about - if such existed.