Welcome to SWI-Prolog (threaded, 64 bits, version 10.0.2)
SWI-Prolog comes with ABSOLUTELY NO WARRANTY. This is free software.
Please run ?- license. for legal details.
For online help and background, visit https://www.swi-prolog.org/
For built-in help, use ?- help(Topic). or ?- apropos(Word).
15 ?- [user].
|: child(greg).
|: cat(greg).
|: man(aaron).
|: dad(aaron, greg).
|: catdad(X, Y) :- dad(X, Y), cat(Y).
|: ^D% user://1 compiled 0.00 sec, 5 clauses
true.
15 ?- catdad(aaron, greg).
true.
18 ?- catdad(X, Y).
X = aaron,
Y = greg.
I’ve never really used Rust, but I’m one of those python programmers that writes 50/50 type hints and actual code lol.
Type systems are really fun to play with. Haskell and Prolog are basically just types as code and I love it.
Writing a ton of Protocols in Python and composing them together is really fun. The flexibility of using the type system with the runtime ducks of Python is actually really sweet. The strict duck is actually really useful in practice too. Plenty of times I need to break strictness to let something busted in the pipeline through.
The proper syntax is
cat dad -> gregclass Child: def __init__(self, name: str) -> None: self.name = name class Person: def __init__(self, name: str) -> None: self.name = name self.children = list[Child]() def adopt(self, child: Child) -> None: self.children.append(child) def __repr__(self) -> str: return f'{self.name} has {len(self.children)} kids' greg = Child("Greg") aaron = Person("Aaron") aaron.adopt(greg)spoiler
Pls forgive the non-monotonic woman reasoning >w<
I love prolog
Also trying to format Python on a phone keyboard is hell. Especially without a monospaced font lol.
I do too, it’s my favorite despite me being rly rusty >w<
I wanna program for fun more again
I’ve never really used Rust, but I’m one of those python programmers that writes 50/50 type hints and actual code lol.
Type systems are really fun to play with. Haskell and Prolog are basically just types as code and I love it.
Writing a ton of Protocols in Python and composing them together is really fun. The flexibility of using the type system with the runtime ducks of Python is actually really sweet. The strict duck is actually really useful in practice too. Plenty of times I need to break strictness to let something busted in the pipeline through.