Live data from Hacker News

Esoteric programming paradigms

ybrikman.com

41–50 of 149 posts

Re: Esoteric programming paradigms

#41

Earlier quoted context omitted.

That's exactly what || (concurrent statements) and ; (sequential statements) do in Esterel.

Thanks, was totally unaware of that. For the lazy and ignorant like me: https://en.wikipedia.org/wiki/Esterel (if you'd like to throw a link in your comment, would be happy to delete this one)

No need :) But I'll happily add this one, which is a nice short intro if you know nothing about it: http://www.embedded.com/design/prototyping-and-development/4...

I came in contact with the language during my studies (one of my profs worked on it), found it interesting, but haven't really had a chance to apply it to anything I've done professionally since. It's a very neat language though, and if I got to do anything in the embedded field.

I notice that there is now an open source compiler, which is great. The only implementation I was aware of so far was closed source.

Re: Esoteric programming paradigms

#43
post #2

Shame not to see factor in the concatenative list, it addresses some of the pain points there with locals

Postscript would also have been a fine addition and has its own methods of dealing with locals. https://www.adobe.com/products/postscript/pdfs/PLRM.pdf [PDF]

Re: Esoteric programming paradigms

#45

ANI 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

Yes, I can't really understand why he didn't mention HDLs. I had never seen ANI before but both the syntax and terminology reminded me of VHDL.

Re: Esoteric programming paradigms

#46

Concurrency by default feels a bit like the underlying processor of the machine, what with superscalar architectures and all.

Hardware Description Languages tend to be concurrent by default, with specific syntax for sequential logic.

A parallel pair of AND gates is physically concurrent, let alone anything with a clock.

Re: Esoteric programming paradigms

#47
post #15
post #10

Earlier quoted context omitted.

Is it useful in writing drivers ? or mostly for application code ? And what are the drawbacks? Why aren't everybody using it?

It's used heavily in application code for automotive ECUs. It has code generators that generate output with a really, really, small footprint and zero runtime overhead; due to optimization at very high levels, this is on the level of really good LTO optimization. Drawbacks: it's very un-agile; you really have to think the system through completely. (The magic being that if you do this, it is very likely correct by de…

>> It's not really feasible to specify a part of the system now and leave other parts open for later refinement.

Is there any work or ideas on how to solve that issue?

And so it's also hard to add features later, in next versions ?

Re: Esoteric programming paradigms

#48
post #45

ANI 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

Yes, I can't really understand why he didn't mention HDLs. I had never seen ANI before but both the syntax and terminology reminded me of VHDL.

These layers of abstraction seem to lead software bloggers to re-discovering concepts known by hardware engineers for decades.

Re: Esoteric programming paradigms

#49

  > 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 "email", at least in PostgreSQL:

  create table contacts (
    name text not null,
    age int check (age >= 0),
    email email
  );
It already has a few of these special types built in, like for IP and MAC addresses (https://www.postgresql.org/docs/current/static/datatype.html).

Re: Esoteric programming paradigms

#50

> 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…

The author got the gist of dependent types wrong. It's not simply about checks. Dependently typed languages allow the result type to explicitly depend on the input data.

Thus, a dependently typed database would allow one columns type to depend on the value of another column.

It would be like saying

  Create table dep ( name text, fieldType int not null, fieldValue (if fieldType = 1 then int else varchar))
Notice the 'if' in the type of fieldValue
Post reply on HN