freenode/#lisp - IRC Chatlog
Search
9:12:02
beach
MayheM_FAN: I know nothing about FFI, but I am guessing you are not providing enough information for anyone to help out, like what you tried in order to get that error, what Common Lisp implementation you are using, on which OS, etc.
9:14:03
beach
MayheM_FAN: That's a very unusual combination. I think most people here use SBCL on Linux.
9:14:44
MichaelRaskin
And if you are using the latest _release_ of CLisp, it's kind of expected to fail to load random things by now…
9:15:03
MichaelRaskin
(development snapshot has at least a chance, releases are too old for anything)
9:17:06
MichaelRaskin
libffi is definitely a library that exists and is used for FFI; no idea where to get a fresh Windows build
9:18:19
MayheM_FAN
loading cl-tcod with quicklisp, while it was loading cffi-features (cl-tcod requires cffi) it gave me that error
9:20:08
phoe
https://proj.goldencode.com/projects/p2j/wiki/Building_and_Installing_libffi_on_Windows
9:20:47
beach
MayheM_FAN: Wow, you really hit the jackpot. Trying to learn Common Lisp starting with FFI using CLISP on Windows.
9:21:10
phoe
I mean, if you're okay with preaching, `apt install libffi-dev` on debian would solve the issue for you
9:29:12
phoe
MayheM_FAN: I see that some chocolatey packages include libffi DLLs, maybe you could scavenge it off one of those
10:16:50
MayheM_FAN
can i just use the prebuild libffi thats on the bottom of https://proj.goldencode.com/projects/p2j/wiki/Building_and_Installing_libffi_on_Windows
10:23:02
beach
MayheM_FAN: Again, my guess is that very few people here will be able to help you, given that they are not using the unique combination of implementation and OS that you are. I hope I am wrong, of course.
10:33:09
phoe
it needs to be the same architecture as your Lisp implementation, otherwise it won't load
14:02:35
beach
TheInformaticist: Multi-paradigm. A lot of modern Common Lisp code uses the Common Lisp object system (CLOS) a lot.
14:05:14
heisig
beach: Saying Common Lisp is not a functional language is like saying German is not a language for writing poems.
14:05:28
MichaelRaskin
(naturally, a lot of Clojure code uses a lot of objects — but from Java object system)
14:05:47
heisig
Neither is true. But it depends mostly on the author/programmer, and not so much on the language.
14:10:46
TheInformaticist
It really hasn't changed? That's a good sign, in my opinion. Everything's getting updated so constantly nowadays, you don't know what's going to be broken next.
14:11:47
TheInformaticist
That's good. By the way, does Common Lisp have primitive procedures for graphics?
14:14:10
beach
MichaelRaskin: When I say or hear "language", I think if a definition, usually in the form of an independent standard, of what some language processor allows or does not allow.
14:15:47
TheInformaticist
beach: You don't get to weasel out of things by making your own definitions.
14:16:29
TheInformaticist
True Basic is ANSI Basic, owned by the designers of the language, Kemeny and Kurtz.
14:17:18
TheInformaticist
And for you info, beach, you can't program a computer with a standard. You need a language for that.
14:18:33
beach
ACTION was under the impression that an "implementation" was required for that. Wrong again, I guess.
14:20:33
MichaelRaskin
Given that an interpreter or compiler typically comes before any standards, and then becomes or not an implementation of standard… no, you can perfectly use a thing that is not yet an implementation of anything
14:28:33
TheInformaticist
You know, I was using a Common Lisp tiling window manager for quite a while, and I really liked it.
14:29:30
TheInformaticist
But then I got EXWM and started using Emacs more. But to be honest, that other window manager was better, because you weren
14:31:26
MichaelRaskin
Yeah, still using StumpWM. And for an editor, I use an editor extending what is promised by an independent standard, heh
14:32:31
MichaelRaskin
Specifically vim; but _some_ vi is required by POSIX/Single Unix Specification (which is approximately the same thing, modulo legalese)
14:36:17
TheInformaticist
Hey, I should make an editor and call it bread...and write it in Lisp. There, I'm on topic.
14:59:43
MichaelRaskin
And liking POSIX Shell. Common Lisp is a valuable tool, not an exclusive religion.
15:07:09
TheInformaticist
Cool. I've also thought that sh or bash tools can be really powerful for cleaning up and formatting data, and yet most "data analytics" people seem to be unaware that these tools exist.
15:23:54
TheInformaticist
MichaelRaskin: Ever use the suckless terminal (which is definitely NOT written in Lisp, unlike eshell)?
15:27:00
MichaelRaskin
That is far into #lispcafe zone. (But nope, urxvt, sometimes xterm and mlterm, fbterm when without X)
15:38:09
mseddon
So given there is no standard way to e.g. locate defstruct constructor function names, how would one go about implementing a custom reader that supports #S syntax vaguely portably?
15:40:36
Nilby
mseddon: Sadly there can't a portable version, but you can make one that has implementation-specific code for most implementations.
15:44:34
mseddon
Nilby right.. i found various classoid apis for sbcl, but there is no reflection defstruct library that would cover that? :/
15:45:38
mseddon
MichaelRaskin, so like eclector I want to track source information, which the standard reader does not support
15:46:28
mseddon
But eclector bails on #S and leaves a hook for you to tie into your implementation, so I wondered if there was a better way
15:47:48
mseddon
Everything else is 100% portable, but sadly I think I have hit an oversight in the spec
15:52:23
Nilby
mseddon: Last time I looked a I didn't find one. I have code that works on sbcl, ccl, and maybe a few others. Maybe the people working on eclector have some suggestion?
15:53:49
mseddon
Nilby thanks, I will check. Certainly trivial defstruct reflection that works across platforms would be useful for me here
16:12:36
Nilby
mseddon: I'm not really a good choice for being a project maintainer, but here's what I had: https://bpa.st/C4OQ . You're welcome to do whatever with it. This was designed for use in eclector.
16:15:52
Nilby
yep. This is one of my top changes I would make to CL. To have a standardized make-structure-instance or something.
16:18:30
_death
for sbcl only the struct name is needed to allocate an instance.. for others you may need something more elaborate
16:25:51
Nilby
_death: Your words have a very high ratio of making me realize I'm stupid and have to rewrite my code. :)
17:10:56
phoe
'(vector number *) most likely becomes '(vector t *) because of the element type being upgraded
17:11:33
phoe
that is because numbers have 1) unbounded size in the general case, 2) can be complex or real
17:12:35
fzfzfzv28
thank you! I tried (typep #("hello") '(vector (integer 0 10) *)) => NIL which makes sense in that context.
17:13:21
phoe
fzfzfzv28: what exactly do you want to do though? check if all elements of a vector are numbers?
17:14:04
phoe
I don't think the CL type system is powerful enough to perform this on the type level, unless you use SATISFIES
17:16:35
phoe
(asking because CL is efficient and nice to play with when it comes to fixed-width byte and float types)
17:17:17
dbotton
what is the lisp way of something I do always in Ada ie create a named type such as myint that has a range of 0 to 100
17:17:56
fzfzfzv28
@phoe: my actual use case is im reducing a vector of strings and functions that produce strings into one string.
17:21:47
phoe
dbotton: e.g. it is common to (deftype octet () '(unsigned-byte 8)) and then e.g. (declare (type octet x y z))
17:22:50
dbotton
I keep getting more excited the further I go in exploring the combo of static and dynamic typing
17:23:52
dbotton
so using satisfied allows that every declared use if the type would pass some arbitrary tesy
17:25:13
phoe
the ranges 1..50 and 55..100 are expressible via an OR type, (or (integer 1 50) (integer 55 100))
17:28:14
dbotton
granted that would require some tools to enforce certain policies but seems that critical systems certainly could be done in lisp
17:29:41
mseddon
dbotton: moreover, it seems to generally more make sense in lisp. Though as you discover, the capability is buried a bit
17:29:48
dbotton
I am finding the level of flexibility at compile time can make this a more then ideal choice once control of the GC in check
17:33:43
mseddon
Dbotton: arian 5 would not have blown up in cl, it wouldn't let you unsafely cast to a 16 bit value
17:34:54
MichaelRaskin
CLISP development snapshot is better, but they cannot get around to make a release
17:37:13
dbotton
once I fully grocked cl I'll plan on doing some docs for my own start on what is needed translation from Ada etc
17:39:52
TheInformaticist
OK, I'll look at both. I also just installed a weird version of Scheme nobody has heard of, LOL...but I know about it because of a professor.
17:46:43
TheInformaticist
I'm also learning C++ right now in class. I know this is crazy, but I'm working overtime, doing all my programming exercises in both languages...trying to see if I can do my final project in a functional style. I want to give my professor a pleasant surprise.
18:50:20
dbotton
anyone know a good resource book chapter or online that would have all the "type checking" related lisp info in one place
19:31:44
Xach
Not great that (asdf:system-relative-pathname "system" "foo") is critically different from (asdf:system-relative-pathname "system" #p"foo"))
19:44:05
Xach
phoe: read the sources; if you pass a string, it goes through asdf/uiop's non-standard pathname parsing mechanism, which mangles e.g. "foo/**/*.txt"
19:51:16
Fare
portable, including to non-Unix systems like Genera, RMCL, Windows, etc., where the separator is not /
20:53:07
AeroNotix
the library I am wrapping sets a struct field to `enum foobar flags:8`. The enum is defined with defcenum. How do I use it like that?
20:53:53
AeroNotix
it seems I will need to override the type in my wrapper from the enum, to type I create with defbitfield. Seems a bit awkward.
20:55:45
_death
heh, I don't think I've encountered anything like that (and I've been doing this for some time..).. I'd guess it's not even standard C, but I could be wrong
21:00:40
AeroNotix
_death: so I'm using swig to generate the bindings... I would like to keep using swig just to make things automatic (unless there's a different auto-approach). I kinda don't want to need to maintain some cffi definition code.
21:03:18
_death
ok, C99 standard 6.7.2.1 paragraph 4 says "A bit-field shall have a type that is a qualified or unqualified version of _Bool, signed int, unsigned int, or some other implementation-defined type".. so I'm guessing it's an extension
21:05:39
_death
AeroNotix: never used swig (well, I may have tried it a decade ago I think..).. for automatic wrapping I use autowrap