11 ms·
Picat – a logic-based multi-paradigm programming language
- philip142au 7y agoReally bad idea... please no imperative
- tempguy9999 7y agoWhy not? Edit: functional is a tool, declarative is a tool, imperative is a tool. There's nothing wrong with any of them, it's whether they're applied correctly that makes them good or bad. They're just tools. Imperative can be the right one sometimes.
- GoToRO 7y agoActually I see all the non-imperative ways as lost time in software development. At some point we will realize that people think imperatively.
- WillDaSilva 7y agoSpeak for yourself. I find declarative programming to be far more intuitive, as it lets me think about how I should go from the data I have to the data I want. Thinking about programs in terms of the steps they're taking to do something generally bogs people down with irrelevant implementation details.
- di4na 7y agoThat is not what the research shows. Quite the contrary
- deleted 7y ago[deleted]
- cultus 7y agoSoftware developers who are taught imperative programming are used to translating their high-level, human thoughts into imperative instructions telling the computer exactly what to do to make the answer they want. With functional programming, one is able to translate thoughts more directly. Non-programmers actually have an easier time with functional concepts like mapping than for loops, non-local mutation, etc. At any rate, imperative languages have a legacy of frankly buggy, shitty software. As programs get larger and more concurrent, this problem is getting much, much worse. That's why functional(ish) libraries like Redux are so popular. They can help tame this complexity. Imperative programming absolutely has its place in certain situations like systems or numerical programming, but it is a poor tool for most things people program. Rust, I think, is imperative programming done right. While it's a bit confusing with all the pointer types, it has the tools needed to safely mutate, etc.
- whateveracct 7y agoI solve problems without thinking imperatively all the time -.- it isn't inherent
- philip142au 7y agoThere are functional languages which have logic programming libraries.
- pmontra 7y agoCongratulations for the code examples on the home page. Not every language designer does that. Plenty of examples on HN. My only criticism is about dots and commas, and I know where they come from. Especially as > Picat, as a scripting language, is as powerful as Python and Ruby. But I'm not adding commas and dots to the end of each line, it's a little nightmare. I'm staying with Python and Ruby for scripting. Is there really no way for logic programming languages to skip commas and dots or is it only a tradition?
- Skinney 7y agoThe commas and dots are operators, not syntax. one, two, three. Is essentially compiled down to: if (one && two && three) { return three; } Whereas one, two, three; one, four. compiles down to: if (one && two && three) { return three; } else if (one && four) { return four; } So yeah, it's not syntax. , === && ; === || . marks end of a condition, so } in C.
- dkersten 7y agoThe issue I see is that a . and a , are tiny little marks on the screen that are super easy to miss and, at a glance, the . , ; all can look the same. Maybe with practice you can spot the differences easier, but certainly as a newcomer to the language its a lot of extra cognitive load. && and || at least are super obvious.
- Skinney 7y agoI don't write Picat, but when I write Prolog the color scheme for Emacs gives those operators a bright color so they stand out.
- dkersten 7y agoRight. As someone who uses raindbow parentheses, I should have immediately thought that it would be solved by the editor. Still, I don't like if readability relies on the editor too much, since you often want to paste or read code elsewhere (on HN, stackoverflow, github, random websites, etc) that may not know about your non-mainstream language.
- sriku 7y agoA previous submission on Picat: https://news.ycombinator.com/item?id=16563349 https://news.ycombinator.com/item?id=16563349 Not sure why the older posting wasn't picked up when I submitted the link.
- detaro 7y agobecause it was "a long time ago"
- its_the_future 7y agoI won't know who Hakan Kjellerstrand is, but if you quote him you should either put [sic] following "suites" or put [suits] instead of it. Gives a bad impression straight off the bat. You could argue language is different from programming but to my subconscious mind it speaks of a lack of attention to detail and excellence.
- auto 7y agoIs it just me, or is there an uptick in boutique programming language posts on HN lately? Not complaining, just curious if anyone else has noticed.
- all2 7y agoIt's been ongoing since I got here (not long ago). I've even contributed some. :)
- TuringTest 7y agoI'd say it's a general trend in industry, similar to that in the 80's with their fourth generation languages. It happens when the current programming languages fail short of solving the most difficult problems the industry faces and programmers explore some paradigms that solve them nicely, but those paradigms haven't been integrated into a single coherent platform. This shift is pretty much happening with reactive functional programming - which solves asynchronous calls in the web -, and to some extent with large-scale module composition, which still lacks a good widely known solution.
- 6thaccount2 7y agoNot entirely...mostly the HN topic effect. Someone posts something on x obscure subject and people find it interesting and then research x on their own and post about x a lot.