zlacker

[parent] [thread] 9 comments
1. Pearle+(OP)[view] [source] 2024-10-13 15:46:56
Really interesting to hear!

I was quite hooked to Prolog in a previous life. Then the limiting factor was the tooling, for really practical use.

Could you tell a bit about your Prolog environment?

replies(1): >>agumon+Zl
2. agumon+Zl[view] [source] 2024-10-13 18:33:41
>>Pearle+(OP)
seconded
replies(1): >>YeGobl+PC
◧◩
3. YeGobl+PC[view] [source] [discussion] 2024-10-13 20:38:59
>>agumon+Zl
I use the SWI-Prolog IDE:

https://www.swi-prolog.org/PceEmacs.html

I suppose it is a bit spartan, but it has a ton of functionality that I find indispensable [1]. For example, when I place my cursor on a variable in the editor it highlights all the variables that unify with it in the same clause, and it will highlight singleton variables in a different colour so you can catch errors caused by typos easily. It is also aware of things like imported predicates, undefined or dynamic predicates, multi-file predicates etc, and will highlight them accordingly. It has some (limited) auto-complete and code-expansion etc. and a status line that gives you very good information about the kind of term you have your cursor on - where it's defined if it's a predicate, its name and arity and how many clauses etc, basically much of the information you can get from querying the program database with various program inspection built-ins. Some of my colleagues use VS Code to write Prolog instead and I keep shaking my head and grumbling about the errors they keep making that they wouldn't if they used the SWI-Prolog IDE instead. Kids, these days. In my youth, we wrote all our Prolog on Notepad! And compiled on Dos!

(nope. never)

SWI also has a graphical debugger, which however I never use:

https://www.swi-prolog.org/pldoc/doc/_SWI_/xpce/prolog/lib/g...

I know some people swear by its name but I prefer the textual debugger. Again this one looks a little spartan :)

More goodies in SWI: cross-referencer:

https://www.swi-prolog.org/gxref.md

And profiler:

  1 ?- profile(between(1,10,_)).
  =====================================================================
  Total time: 0.000 seconds
  =====================================================================
  Predicate                       Box Entries =    Calls+Redos     Time
  =====================================================================
  between/3                                 1 =        1+0         0.0%
  true.

And lots and tons of facilities for debugging and error handling, unit testing, all sorts of libraries, a package manager etc.

________________________

[1] You can customise the IDE colours too. There's a dark theme:

https://www.swi-prolog.org/pldoc/man?section=theme

There's some screenshots here:

https://swi-prolog.discourse.group/t/questions-about-ide-the...

replies(2): >>nextos+RL >>agumon+i21
◧◩◪
4. nextos+RL[view] [source] [discussion] 2024-10-13 21:47:38
>>YeGobl+PC
Do you use Prolog in Academia or you have moved to Industry?
replies(1): >>YeGobl+KX1
◧◩◪
5. agumon+i21[view] [source] [discussion] 2024-10-14 00:22:50
>>YeGobl+PC
ha, yet another emacs derivative I didn't know of

thanks for your help

replies(1): >>YeGobl+aY1
◧◩◪◨
6. YeGobl+KX1[view] [source] [discussion] 2024-10-14 11:33:36
>>nextos+RL
I moved to academia, after six years of working in the industry mainly with C# and SQL. It was a deliberate attempt to find a way to work with Prolog. I guess that's a bit immature of me but I fell in love with Prolog in the second year of my CS degree and I couldn't get over it so here I am.

I did an MSc in data science first, then started a PhD to study Inductive Logic Programming (ILP), which is basically machine learning × Prolog (although there's also ASP ILP these days). I got my PhD last summer and I'm now doing a post-doc on a robotics project with Meta-Interpretive Learning (MIL), a recent form of ILP. Here's my latest publication:

https://github.com/stassa/ijclr_2024_experiments

Which is still a bit proof-of-concept. We're still at the very early stages of practical applications of MIL and so there's a lot of foundation work to do. Bliss :)

replies(1): >>crypto+fr2
◧◩◪◨
7. YeGobl+aY1[view] [source] [discussion] 2024-10-14 11:36:50
>>agumon+i21
Right, it's an emacs clone. There's also Sweep, an emacs mode for Prolog.

https://eshelyaron.com/sweep.html

When I grow up, I'll give it a try :)

◧◩◪◨⬒
8. crypto+fr2[view] [source] [discussion] 2024-10-14 15:21:25
>>YeGobl+KX1
You might want to look at the Icon programming language. I fell in love with it long ago, but I did not go the academic route to use it more, I just accepted that it wouldn't be a part of my work life. Later -much later- I found jq, with which I had more success in industry. Both are very much like logic programming languages in that they have pervasive (DFS) backtracking.
replies(1): >>YeGobl+pk5
◧◩◪◨⬒⬓
9. YeGobl+pk5[view] [source] [discussion] 2024-10-15 15:13:05
>>crypto+fr2
Oh, I see Icon is a descendant of SNOBOL. I'll have a look, that seems interesting.

Thanks for the pointer :)

replies(1): >>crypto+Jz5
◧◩◪◨⬒⬓⬔
10. crypto+Jz5[view] [source] [discussion] 2024-10-15 16:41:10
>>YeGobl+pk5
I hope you enjoy it! I sure did. If you enjoy it, you might also enjoy jq (https://github.com/jqlang/jq), which is also a sort of logic programming language (in that it has pervasive generators and backtracking). Icon has an Algol family syntax, while jq is more... Haskell-ish? in a way if you squint hard? Whereas Prolog is a pile of rules. These differences are very interesting. Verse is another language in this vein, and it seems very interesting as well.

Oh, and yesterday's HN thread about Rama is very interesting as well: >>41833629

[go to top]