Esoteric programming paradigms
71–80 of 149 posts
Re: Esoteric programming paradigms
#72First, declarative programming is a generic name which includes a broad range of paradigms - from functional to logic programming. Logic programming is something that deserves a special mention and discussion, because there are a number of interesting and unique concepts that deserve a more in-depth explanation.
Second, "dependent types" is better understood as a feature of a language (or better yet, of a type system) than a paradigm by itself.
Some of the other "paradigms" also seem more like characteristics of languages, and not really something that structures the way solutions are expressed/understood.
Re: Esoteric programming paradigms
#73'Concurrency-by-default' is similar to a notation I've been using to map out async service calls. It's just this: lines are terminated with "," or ";". A comma doesn't block and all comma-separated lines are executed in any order, while a semicolon blocks. Names are only usable when a semicolon is reached, and a semicolon unblocks flow when all preceding names are bound. Probably code is scoped into { } blocks. So a…
Re: Esoteric programming paradigms
#74ANI reminds me of HDLs [1] - I'm assuming that's the inspiration with terminology like "latch"? Hardware is also concurrent by default. Coding some hardware logic will also change the way you approach coding. Anyone who's interested get an FPGA demo board and write some verilog or VHDL - I highly recommend it. 1. https://en.wikipedia.org/wiki/Hardware_description_language
Can anyone recommend a good course/book/tutorial for learning Verilog/VHDL? I have a demo board from a course I took in college and would love to try doing some projects with it, but I've had a hard time finding any good learning material.
Of course, always remember that "can be compiled" != "can be synthesized".
Re: Esoteric programming paradigms
#75> Dependent types > > Example languages: Idris, Agda, Coq > > You’re probably used to type systems in languages like C and Java, > where the compiler can check that a variable is an integer, list, or string. > But what if your compiler could check that a variable is “a positive integer”, > “a list of length 2”, or “a string that is a palindrome”? This is what I love about SQL. You can even define your own types, like…
Out of interest, how is common ORM support for custom Postgres types?
Re: Esoteric programming paradigms
#76I don't know if Prolog should be called esoteric. Prolog is an ISO-standardized language after all, and its syntax has been used for 4+ decades now in most papers on conceptual database system and query language design I've read. Which isn't surprising since Prolog syntax, being based on operator-precedence grammar concepts, is arguably as minimalistic as it gets. There's definitely also a lot of interest lately in D…
Considering they also mention SQL and Forth, I think this could probably equally be called "things that confuse someone who only knows C".
Forth is known by name and reputation but very few people have ever tried to write anything in it - let alone delve into it's strange bootstrapped nature.
Re: Esoteric programming paradigms
#77Agent oriented-programming http://robotics.stanford.edu/~shoham/www%20papers/AgentOrien... [PDF]
Telescript and Obliq come to mind.
Re: Esoteric programming paradigms
#78First, the article claims: "the sudoku solver above does a brute force search", but that is specifically not the case. In fact, quite the opposite holds: The Prolog Sudoku formulation shown in the article uses a powerful technique known as Constraint Logic Programming over Finite Domains, which automatically performs pruning before and also during the search for solutions. This effectively eliminates large portions of the search space in practice, and degenerates to brute force only in those cases where almost nothing can be deduced from initial constraints. In the particular case of Sudoku, the pruning is especially effective and can in many cases eliminate the search entirely, since the initial constraints (hints) basically determine the whole solution.
Second, yes, it is easy to write an O(n!) search algorithm in Prolog. However, it is almost as easy to implement much more efficient search algorithms in Prolog. For example, here is Quicksort in Prolog:
quicksort([]) --> [].
quicksort([L|Ls]) -->
{ partition(Ls, L, Smalls, Bigs) },
quicksort(Smalls), [L], quicksort(Bigs).
Note how natural the declarative description of "first the smaller elements, then the pivot element, then the bigger elements" is in Prolog. This only requires a suitable implementation of partition/4, which is very easy to implement in at most 7 lines of Prolog code.Re: Esoteric programming paradigms
#79Earlier quoted context omitted.
Telescript and Obliq come to mind.
The Telescript reference I understand since that was General Magic's goal with Magic Cap, but I'm not sure I see how Obliq is an agent oriented programming language. It seems to be a object oriented one.
Re: Esoteric programming paradigms
#80https://esolangs.org/wiki/Rail https://esolangs.org/wiki/Billiard_ball_machine