[ / / / / / / / / / / / / / ] [ dir / abdl / acme / agatha2 / animu / arepa / tacos / vg / voxed ][Options][ watchlist ]

/tech/ - Technology

You can now write text to your AI-generated image at https://aiproto.com It is currently free to use for Proto members.
Email
Comment *
File
Select/drop/paste files here
Password (Randomized for file and post deletion; you may also set your own.)
* = required field[▶ Show post options & limits]
Confused? See the FAQ.
Expand all images

File (hide): 2e1a2fecfabd799⋯.png (59.75 KB, 1279x665, 1279:665, paradigms.png) (h) (u)

[–]

 No.996393>>996418 >>996445 >>996448 >>996550 >>996575 [Watch Thread][Show All Posts]

I've been thinking about programming paradigms recently, and in particular I've been thinking about what languages represent the peak of each paradigm.

I've yet to determine how many paradigms there actually are, or at least which are important and distinct enough to be worth considering. So far I've got:

Procedural

Object-Oriented

Functional

I'm considering:

Logic

Symbolic

Dataflow/Temporal/Synchronous/Behavioral (not sure what the right word is for this family of languages - somebody educate me please.)

The more interesting question, then: which are the archetypal languages of each paradigm? The obvious answers are:

Procedural

C

Object-Oriented

Java

Functional

Haskell

But I don't think that going by prominence is necessarily the correct approach. C has been endlessly complained about since it's creation, and with good reason. A Wirthian language like Oberon might better deserve the title. Java isn't really an Object-Oriented language at all, if we go by Kay's definition - Smalltalk, then, should be chosen (Pharo? Squeak? 72/76/80?). Haskell is probably the only one of the three that has a real claim, but perhaps a dependently-typed language would be "more functional"?

 No.996411

>Parallel processing

I don't know if concurrent languages like erlang count, or if this means more like CUDA.


 No.996418>>996550

>>996393 (OP)

>Logic

Prolog


 No.996420>>996435 >>996550

Prolog for logic programming. There are many languages using the logical computation paradigm but prolog is to logical programming what LISP is to functional programming.

Anyone here ever used prolog? It's like an alien world to me, only mentioned in some obscure japanese A.I. paper.


 No.996435>>996438 >>996550

>>996420

>but prolog is to logical programming what LISP is to functional programming.

AKA not very logical, and in the case of LISP not very functional. Prolog has an inferior inference algorithm that means that many functions have to written in horrible ways. Instead of concentrating on the function / relation you waste time on the interpreter / compiler implementation details. For a real modern logic language try "mini kanren". You can do things like write a scheme interpreter in the langauge, and then simply ask the language "generate programs for this interpreter that always evaluate to 2", and mini kanren will go on and generate every possible one forever (or up to your cap). As for functional programming Haskell is a much better example than Lisp. Lisps use imperative programming absolutely everywhere.


 No.996438>>996440

>>996435

Interesting, very interesting. Still you have to keep in mind that LISP was proposed in a time when actual boomers were going through puberty/wetting their bed. Haskell is indeed more pure but it doesn't have the same mantle that LISP has, it also hasn't survived for 60 years.


 No.996440>>996441

>>996438

>it also hasn't survived for 60 years.

Yes anon it is only 30 years old. Woop woop.


 No.996441>>996445 >>996550

>>996440

I'm not saying it as a good or a bad thing. It just means that LISP is in the very root of functional programming while haskell just came along.

People have lived shorter lives than the difference between the two languages' ages, just because the numbers are above 10 doesn't make the difference trivial.


 No.996445

>>996393 (OP)

> represent the peak of each paradigm.

>>996441

Sorry anon when did op say oldest possible example?


 No.996448

>>996393 (OP)

Procedural

Computers

Functional

Mathematics

Object-Oriented

Cog oriented book authors


 No.996550

>>996393 (OP)

Per Haskell, there was a recent paper, Exceptionally Monadic Error Handling? It's quite a nice arguement for throwing more mathematics at the problem to eventually solve it. As well as Ghost of Departed Proofs, which is another interesting manner by which we can enrich the type system without going full dependent types. The main issue is paying the complexity cost where it isn't necessary.

For something like C, Haskell, languages that end up mattering is a rekindling interest in functorial programming. Instead of dealing with the primitives of the languages, compilers, but forming meaningful algebras/contexts/DSLs on top of the base language like previous paragraph related.

>>996435

>>996420

>>996418

Iirc, datalog was used for optimising relational databases, and this was later improved with the reapplication of proof propagators from SAT/SMT solvers. Needless to say, you can really throw more math at the problem. Remember, CHL Iso is real, and whatever you use to extend one of the related theories can be used to extend another. Epistemic logic extends not only logic, but also type theory allowing for language constructs to have a concept of not having total information, but that some remote computational node does. Distributed computing.

>>996393 (OP)

Thinking of, that last example is probably the beginning and end of "parallel processing". For data-flow processing, I think you'd base your computational graphs in terms of Arrows, a la Tweag's Funflow workflow library.

>>996441

It was something like LISP to various research languages which I think eventually sorted itself out into the Schemes and MLs. Some small languages like Miranda and so on happened, but died out, each with their own novelty. Then Haskell was a strange case where the people that would've made thousands of research languages and some undying languages, they decided to put all their efforts into making one language.

Haskell is a strangely lively language, and while GHC dominates, there's been recent moves to absorb all the novelties of the rare or dead compilers. As it turns out GHC hasn't been able to steal anything new from ML for a few decades.


 No.996575

>>996393 (OP)

>Functional

>Haskell

I'd say ML in general, though.


 No.996774>>996785 >>996865

There are some languages that are good examples of a paradigm, but they are not at a peak because they can still be improved. They also have different philosophies and principles.

Procedural: Ada, Algol, Fortran, Pascal, PL/I

Object-Oriented: Common Lisp (CLOS), Dylan, Smalltalk

Functional: Haskell, "pure" Scheme

Java can't be the archetype or peak of OOP because there were a lot of advances in OOP before Java like multiple inheritance, multiple dispatch, and everything being an object. The reason so many people complain about "OOP" is that UNIX languages like C++ and Java ignore decades worth of solutions that solve the problems they have in those languages. Weenies will say some bullshit about the solutions being "bloated" so they never get used, then they complain about a lack of solutions even though they work fine in other languages. In many cases, the solutions are older than the problems they created by not understanding the solutions.

C is the peak and archetype of the suck paradigm. If C++, Java, JavaScript, and all these other UNIX languages were not based on C, they would be higher quality, simpler, and more productive.

C is supposed to be a "simple" language but they didn't even think of the interaction between macros and the { and } in compound literals. This is considered a minor cosmetic problem but it would have been a complete embarrassment if this kind of thing happened in a good language. This is another example of the solutions being older than the problem. The "designers" didn't care and neither do the standards committee, and it sucks.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2299.htm

What really sucks is that the people who wrote the C standard don't even understand what they wrote. This kind of bullshit has nothing to do with any paradigm.

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2243.htm

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2263.htm

http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2294.htm

   I've been confusing my compiler class with this one for
a while now. I pull it out any time someone counters my
claim that C has no block structure. They're usually
under the delusion that {decl stmt} introduces a block
with its own local storage, probably because it looks
like it does, and because they are C programmers who use
lots of globals and wouldn't know what to do with block
structure even if they really had it.

But because you can jump into the middle of a block, the
compiler is forced to allocate all storage on entry to a
procedure, not entry to a block.

But it's much worse than than because you need to invoke
this procedure call before entering the block.
Preallocating the storage doesn't help you. I'll almost
guarantee you that the answer to the question "what's
supposed to happen when I do <the thing above>?" used to be
"gee, I don't know, whatever the PDP-11 compiler did." Now
of course, they're trying to rationalize the language after
the fact. I wonder if some poor bastard has tried to do a
denotational semantics for C. It would probably amount to a
translation of the PDP-11 C compiler into lambda calculus.


 No.996785

>>996774

>they are not the peak because they can still be improved

The best language available to represent or implement a programming paradigm is what he wants, i think he doesn't care much about theoretical maximums.

As someone whose only ever programmed C for embedded stuff and python/bash scripts functionally, could someone explain/provide some good links or reading on dataflow programming? this is the first time I've heard of it, probably because i don't write programs to crunch numbers or interpret data. It sounds fairly interesting, I would like to know more.


 No.996865

File (hide): 7f9e1073e944dd6⋯.png (215.31 KB, 392x411, 392:411, 8.png) (h) (u)

>>996774

>If C++, Java, JavaScript, and all these other UNIX languages were not based on C, they would be higher quality, simpler, and more productive

>in the same post where he shills infamous clusterfuck PL/I

>the language legendary for being an absolute bitch to parse and compile

What a hypocrite. C++, Java, and JavaScript are bad because they aped an existing language and bolted their own stupid ideas on top without considering how well they fit. If their creators did the same thing but with Algol or Fortran instead, they'd probably end up with a similar mess.

The other languages you mentioned are interesting and have their niches, but there's reasons why they haven't upstaged C aside from your "muh bloat" strawman.


 No.996866

File (hide): 67ba3fd556346ba⋯.jpg (75.5 KB, 600x450, 4:3, 67b.jpg) (h) (u)

>The supervisor for CTSS, the early 1960s predecessor system to Multics, had been written almost entirely in the 7094 assembly program, FAP.


 No.996872

inb4 "but the infallible Multicians made a PL/I compiler"

Both the EPL compiler and its replacement were slow as shit (both compiling and the output's execution speed) and the multicians site admits this: they had to use a subset of the language to get anything resembling reasonable performance and even after that it still sucked dick compared to their Fortran compiler.




[Return][Go to top][Catalog][Screencap][Nerve Center][Cancer][Update] ( Scroll to new posts) ( Auto) 5
16 replies | 2 images | Page ???
[Post a Reply]
[ / / / / / / / / / / / / / ] [ dir / abdl / acme / agatha2 / animu / arepa / tacos / vg / voxed ][ watchlist ]