libera/#lisp - IRC Chatlog
Search
21:01:27
prokhor__
White_Flame: maybe youll have a look at the quixote kr language/db some time (implemented in guarded horn clauses)...
21:01:49
Shark8
prokhor__, That's a solid plan; the only things that I would recommend are: (1) have your "target" for the translation [mostly] fixed, e.g. as you said separating facts & rules, so that your "structure" is consistent; (2) consider whether or not [and how much] the Cyc/CycL views should be structured into it as well; and (3) consider whether it would be useful to have a common-interface such as using facts & rules interchangeably WRT the "public" or
21:01:50
Shark8
"private"-interface (that is to say, whether it would be useful to have "implementation-hidden" objects, using a good interface to "unify" interaction).
21:02:33
White_Flame
prokhor__: it doesn't seem on the surface that GHC changes the actual syntax all that much
21:03:08
White_Flame
in terms of what you can & can't do with prolog, but I haven't looked into quixote specifically, just read through taht ghc paper
21:06:43
prokhor__
https://www.airc.aist.go.jp/aitec-icot/ICOT/Museum/SOFTWARE/QUIXOTE/introE/primer1.html
21:39:02
prokhor__
Shark8, White_Flame: thx for the discussion btw, didnt have such a good talk in a while...
21:42:49
Shark8
prokhor__, I had a good talk, too; last year I was in the middle of going down the IR rabbit-hole, thinking about several things: how it would have been better if (e.g.) WebAssembly had done a more parallel-friendly design [akin to the conclusion in the Guy Steele vid], how to design the IR to be storable/decomposable in a DB, and how to manipulate such a DB-based IR.
21:48:46
prokhor__
but the essence of that vid, imho, is like White_Flame said: the implementor has to deal with the implementation, so the user doesnt have to...
21:58:03
Shark8
prokhor__, Yes, but again with the caveat that you can make things easier on yourself; as I used in the example upthread, you could have gotten an OS to be multi-core by writing the OS using the TASK/TASK TYPE in Ada and recompiling with a multicore aware compiler, exactly by minimizing your dependence on the implementation details (via usage of the TASK/TASK TYPE constructs).
21:59:51
prokhor__
i think there is not one correct answer to that... everybody does as he is used to/suits him best...
22:00:51
Shark8
In some sense it *is* sweeping things under the rug (ie being unconcerned that the TASK *might* be compiled with only a single-core assuming compiler) and putting the onus on the compiler, but on the other hand it's (a) using high-level specification/construction, and (b) allowing the abstraction to be interpreted/realized in some other manner.
22:00:57
prokhor__
i have some vague top-level ideas of my implementations, but i also test them by thinking about specific low-level problems in those cases...
22:03:58
Shark8
prokhor__, (re: Top-down vs Bottom-up) -- I've talked with some programmers who really love Ada because you can do some nice things like Top-down design and bottom-up implementation (in this case by defining the packages, types, and [visible] subprograms [as stubs], getting a clean compile, then "backfilling" by implementing them).
7:28:59
rendar
can we say that apply internally checks the number of arguments that the functions accepts, and if its 2, and the list of params len > 2, it will act like a reduce
7:36:55
wasamasa
you can translate a function accepting several arguments to a function accepting one argument less
7:42:12
wasamasa
if you want to expose apply to the lisp interpreter, it's slightly bit more complicated
7:51:40
rendar
wasamasa, the problem with `return func(*func_args)` is it works when i call (+ 1 2), but it doesn't when i call (+ 1 2 3)
7:52:23
wasamasa
in scheme (+) returns 0, (+ 1) returns 1, (+ 1 2) returns 3 and (+ 1 2 3) returns 6
7:53:27
wasamasa
you need to implement + in terms of functools.reduce, not apply in terms of functools.reduce
7:54:22
wasamasa
no, you need to look at every individual function you need to implement and decide how
7:54:57
rendar
the point is that in lisp every 2-ary functions like +, -, / and so on, seem to take N args
7:55:27
rendar
a kind of minimal lisp just to insert commands in a system, minimal ability to create functions and macros
7:57:51
wasamasa
you still need to decide how basic arithmetic should behave and how a useful standard library looks like