libera/#commonlisp - IRC Chatlog
Search
21:16:30
jcowan
One reason langs with a C FFI rarely have a C++ FFI are header-only libs (there are many others, from overloading to exceptions themselves
22:26:48
lotuseater
mfiano: So kind of itself younger sibling "No, I don't want to play with them!" :D
0:21:08
moon-child
jcowan: as far as I know, the only languages that interface directly with c++ without compiling to it are d and raku. Are there any other notable ones?
1:29:36
ln43
Hi all, i'm using Portacle on windows and quicklisp to load closer-mop but it does not seems to work since when i do closer-mop: and press tab there are not completions for the symbols exprted by that pachage
1:31:46
ln43
and to be sure i tryied to replicate the example in clcookbook (https://lispcookbook.github.io/cl-cookbook/clos.html) but whitout success using that system
1:32:11
ln43
so ... i would like to use it in order to install sicl and without maybe i can't procede further
1:37:53
ln43
is there a way to remove closrer-mop with quicklisp and then try to reinstall it (maybe from github)?
1:39:05
ln43
really i can't figure out how to proceed and a possible way to solve the issue: closer-mop in my case seems that doesn't works ...
1:42:44
ln43
yes i'm trying to reboot again sicl but the issue is that a symbol that should be required and it's defined inside that package is not available during the sicl boot
1:50:27
ln43
anyway yes moon-child, i will try to delete the actual package and reinstall it but after inspection of the package's folder everythong seems ok... do you know if there is any other way to have closer-mop working ?
2:27:13
Guest92
so (april:april-load ...) is a compile-time macro, I inserted it within a let block, but it is not evaluated when I call the function which houses the let block
2:30:19
White_Flame
in that case, the macro might be calling some other utility function which actually does the work. you should see if you could call that function instead
2:31:02
White_Flame
it's very handy for loader tools to work at compile-time, to capture any compilation errors right away as opposed to waiting for runtime, which is why it's written that way
2:32:42
Guest92
I have to modify my apl file, switch to the lisp buffer, compile, switch to slime buffer, test the function
2:39:14
saturn2
lotuseater: well, the author(s) of april could use eval-when to make it work the way Guest92 expected
2:39:49
Guest92
phantomics loads. Nested array model? or flat array model? or based array model? or...
2:41:29
moon-child
(my own implementation also uses that array model, which I didn't realise until I compared it to dyalog and dzaima and got strange results. I was somewhat gratified to find april behaved the same way!)
2:41:45
phantomics
However, you could have something that operates on lists if you pass the lists within an array and then use the :store-fn option to store a function within April that works on lists
2:42:31
phantomics
moon-child: in what places have you found April's arrays behaving differently from Dyalog?
2:43:50
phantomics
The underlying model is different but the behavior should be similar, since I automatically do some types of postprocessing to emulate Dyalog's behavior
2:44:08
mfiano
Where is AMOP's #'class-direct-methods defined? I don't see it defined in the book or in closer-mop.
2:44:15
phantomics
Guest92: you should be able to pass the same (with ...) parameters to (april-load) that you do to (april)
2:44:30
moon-child
hmm, that might be it. Perhaps I was using an older version? I seem to recall that ⍴0⌷(1 2)3 was ⍬ in dyalog, but ,2 in april
2:46:53
lotuseater
phantomics: I was curious how you are the last days since we queried recently, so good you're back. :)
2:47:00
moon-child
~inconsistencies. Personally, I find the 'nested' approach less consistent. Especially for things like /
2:47:33
phantomics
Been busy with work and getting some last to-dos checked before a new April release
2:47:53
moon-child
(indeed, sometimes I think boxes may actually be ideal. If it was good enough for sharp...)
2:50:16
phantomics
Guest92: The only docs for it now are here: https://github.com/phantomics/april#unique-language-features-in-april
2:51:20
phantomics
Maybe, or I may just try writing a BQN compiler since first-class functions are native to that lang and I could port all the April function impls over
2:52:28
phantomics
Scoping is the same as in Dyalog, when you assign a var inside a defn it's lexically scoped but you can do for example x←⊢1 to modify a variable outside a defn
2:54:23
Guest92
phantomics I guess what I meant by lexical scoping, are full clojures supported, because they are not in dyalgo
2:55:49
phantomics
You can see a good sample of what's supported in the April demo source files like this one: https://github.com/phantomics/april/blob/master/demos/dfns/array/array.apl
2:57:07
phantomics
One of the main differences to be aware of it that in user-defined operators, you use an underlined character like ⍹ to use the right operand as a value, and ⍵⍵ to use it as a function
2:57:25
phantomics
Handling the operands as either operands or functions is a real pain when compiling
2:58:40
phantomics
Guest92 other files: https://github.com/phantomics/april/blob/master/demos/dfns/numeric/numeric.apl https://github.com/phantomics/april/blob/master/demos/dfns/graph/graph.apl
3:01:50
phantomics
Gotcha, that behavior is undefined, afaik it will work in some situations but break in others
3:02:27
phantomics
Nameclasses are handled by accounting of symbols in a lexer postprocessing stage that happens after the lexer converts characters to tokens but before those tokens are fed to the compiler
3:03:00
Guest92
so why april, and not a standalone? How "serious" is april? As in is it yet another APL toy or does it have a longer term agenda?
3:03:56
phantomics
My goal is for April to be a professional-grade tool, not a toy. I'm using it in a hardware startup currently.
3:05:53
phantomics
For instance, check out the comment at the bottom of https://github.com/phantomics/april/blob/master/spec.lisp
3:06:29
phantomics
You'll see the syntax for extending April's idiom with a new function, you can make a function or operator out of any Unicode symbol you like, as well as customizing the grammar patterns and utilities
3:06:43
hayley
I'm starting to think I need an APL implementation so I don't lose my mind in data science classes. So the best move would clearly be to use cl4py and April to embed APL in Python.
3:07:32
phantomics
As far as interop patterns, I'm often writing CL functions that wrap around an (april-c) call
3:08:10
phantomics
There's a lot of depth to interop I have yet to explore via the :store-fn parameter
3:08:21
hayley
The other thing is that I need to write code in "Python", so downloading a language implementation manually is out of the question.
3:09:00
Guest92
so what is your development cycle for such functions when april-load needs a recompile?
3:09:36
lotuseater
it can also be greatly seen and used as kind of a very powerful DSL to shorten code even more :)
3:10:50
phantomics
I don't get why vector langs don't dominate in data science, they're vastly superior to any alternative for the field
3:10:57
saturn2
phantomics: you should probably make april-load expand to (eval-when (:compile-toplevel :execute) ...) rather than doing the work directly in the macro function
3:12:14
hayley
One fun example was counting the even numbers in an array. Should I write +/2|array or [x % 2 for x in array].count(0)? At least in Lisp we get COUNT-IF and EVENP.
3:14:28
moon-child
cl doesn't even have many good tools for tacit programming. I think the only thing I'm regularly able to do point-free is :key #'c*r and similar. But no compose, hook, partially apply, ...
3:14:30
hayley
I'd also like a better relational algebra library too; Pandas seems to be picky about the order of operations sometimes. And apparently it gets too slow with mere thousands of rows.
3:14:47
Guest92
phantomics I don't understand why the concept of a general programming notation is not dominating computer science in general
3:15:03
Guest92
array programming languages tend to not be able to differentiate between the notation and notation on arrays
3:15:47
moon-child
Guest92: the arrays are an essential aspect of the notation. https://www.reddit.com/r/apljk/comments/p4je0e/j_can_look_like_apl_vscode/h94ldvf/
3:15:58
phantomics
One annoying shortcoming in APL is the inability to specify a matrix in code without really hackneyed syntax like x⍪←1 2 3 ⋄ x⍪←4 5 6
3:16:15
Guest92
moon-childI knw that's the dogma from the iversonian camp, but I think a generalized programming notation is the benefit of APL, not MERELY the arrays
3:16:19
moon-child
Guest92: I distinguish left compose from right compose. ((lcompose f g) x y) ←→ (f (g x) (g y)). Whereas ((rcompose f g) x y) ←→ (f (g x y))
3:16:22
phantomics
But with April you can specify the matrix in CL like #2A((1 2 3)(4 5 6)) and then pass it into April
3:19:00
moon-child
so, not as a first-class combinator, but something you have to implement yourself
3:19:45
moon-child
obviously these are trivial to implement in any language with combinators. The question is, are those combinators primitive?
3:20:23
Guest92
https://codeberg.org/ndrogers/kpl/src/commit/58aa17d06c03d10ff8abc006263efce62c106037/apl.k#L75
3:20:42
moon-child
yes. Again, they can be trivially implemented in most languages. But they are not built in to most languages. That's all.
3:21:38
Guest92
moon-child I understand what you mean, Dyalog has many features of J because Roger Hui works for Dyalog now
3:24:23
beach
minion: memo for ln43: I think I introduced the problem you observed without noticing it, and then pushed the changes. So another pull would have fixed it.
5:36:53
Guest92
so I'm trying to define a package which depends on libraries and I want to then execute a primary function as a scrip
5:37:35
Guest92
i have an .asd file that has a :depends-on, and then I try to call a `sbcl --script file.lisp` that is mentioned in my .asd, but I don't think thats it
5:38:54
beach
I think you mean that you are trying to define a "system" rather than a "package", no?
5:44:41
White_Flame
CL has a history as an OS, and thus plays much better with the repl than external launching, though you can generate full executables
5:45:02
White_Flame
the scripting environment hasn't taken off that much, though there are some utilities to help launch from various OS's cmdlines
5:47:47
White_Flame
oftentimes to accomplish that, you'll build an executable image from the lisp that the other program can launch. That avoids portability issues
5:48:16
White_Flame
(portability between different CL implementations, launching from different users, etc, not OS portability ofc)
5:48:44
White_Flame
or, you have the lisp running as a server, and it receives requests from other programs
5:49:00
White_Flame
but certainly you can make a little scripting solution that works for your exact use environment setup
5:50:24
White_Flame
or sbcl --script, if your .lisp script file does (load "~/.sbclrc") as its first thing
5:51:53
White_Flame
the various options affect if the debugger is launched, does it automatically exit, etc
5:54:32
White_Flame
either it needs to be symlinked from ~/quicklisp/local-projects/, or added to your asdf:*central-registry* to be visible by default
5:58:55
Guest92
ah, so defpackage, then in-package, then the code I need with a (cl-user::exit) at the end does what I need
6:05:56
rain3
file.lisp: (defun main () (ql:quickload :your-app) (app:do-stuff) (sb-ext:exit)) sbcl --load file.lisp --eval "(main)"