freenode/#lisp - IRC Chatlog
Search
20:15:10
rumbler31
so i've wondered, while the graph of types is nice, what do people really use it for?
20:25:07
pjb
rumbler31: to know that you can call the function (defun f (x y) (+ x y)) with as arguments any pair of numbers, including fixnums. Or complexes.
20:44:20
jasom
Xach: I seem to recall someone saying that it wasn't quite a lattice due to certain array type rules?
22:10:04
vsync
this may already be documented but why does ASDF have (ASDF:LOAD-OP op ...) rather than (op ...)?
22:16:20
Shinmera
oos stands for "operate on system" and will construct the operation object for you, then compute a plan for said operation on the given component, and finally execute it.
22:16:59
Shinmera
Because PERFORM is a method that uses multiple-dispatch so you can specify on component, operation, or both.
22:17:25
Shinmera
So making a method for each operation instead, aside from not allowing you to associate data with the operation, would be less flexible.
22:18:15
Shinmera
Invoking the MOP and other such things is not exactly a great idea for something that should work on every implementation seamlessly.
22:18:55
vsync
or, "you have a problem and decided to use metaprogramming... now you have a problem-factory-factory" take your pick :)
22:20:31
vsync
and yes, I think I've just bought in to redoing my design to eschew gratuitous metaclasses
22:21:16
vsync
though I still feel like slots on the metaobject class are conceptually cleaner than :allocation class on the instance class
22:21:47
vsync
but the key seems to be taking a step back and figuring out my protocol before the modeling... it feels like the answers will naturally come forth
22:23:12
vsync
I always go for interface-first... protocol classes with more detailed subclasses seems to be the same at a very slightly higher level of abstraction
22:23:52
Shinmera
The interface is about how you use something, and the protocol is more about how things interact. There's an overlap, but not necessarily so.
0:18:18
z3t0
but for some reason I cannot do this when inside a function, as the item just doesn't get added... even though the return value of (push) is correct
0:18:32
Bike
(push item list) macroexpands to (setf list (cons item list)), i.e. it just alters a variable binding. the variable is bound by the function, so the push doesn't affect the caller's environment.
0:19:22
Bike
it's like, if you had (defun foo (x) (setf x (+ 5 x))) (let ((n 3)) (foo n) n) you'd get 3, not 8.
2:01:27
vsync
jasom: ah good to know... my question was more about the underlying architecture though
4:36:21
beach
I am willing to bet that there are more European Lispers here than North American Lispers.
4:38:42
lambdice
i think i read that lisp was promoted by ppl from MIT, while ppl on the EU choose prolog
4:41:24
flavio81
if i have read correctly, on a paper by Richard P. Gabriel on the history of Lisp, part of the reason the USA pushed for standarizing Common Lisp was that they were afraid the EU could do it before them
4:42:44
beach
Things have changed. The US industry and academia abandoned Common Lisp. Nobody in Europe ever used EuLisp it seems. Now, Common Lisp seems to be used more outside the US than inside.
4:43:34
beach
Now, Poland seems to be the center of activity in the Common Lisp world. I think that is great.
4:44:20
flavio81
Poland? amazing, i had a visit from two high level polish guys from my company, they command a team of data analysts (among other people) and they thought Lisp was a 1950s language (implying no further evolution)
4:44:53
flavio81
well, better for me, perhaps one day they'll get me a job there, once I finally grok CL
4:45:25
beach
shka_: Look at it this way. Currently Poland has the advantage of a high level of skill in its programmers, yet salaries are low. Soon, salaries will rise to the level of the rest of the EU. Then what will you do? One way to stay ahead would be to use better programming tools, so that you can be more productive than others.
4:47:12
flavio81
i just surveyed superficially the language (clojure) and most of its core and constructs. I guess that if they make me choose between java and clojure, i'll gladly take clojure; however if i had to choose between CL and clojure i'd take CL. Nevertheless, i think getting paid for writing in any lisp would be great.
4:48:50
flavio81
i simply don't like how clojure is deeply interwined with java. Even the nomenclature. For example in Lisp, you know what it's an "atom". But in clojure, an "atom" has a different meaning, lifted from java.util.concurrent.atomic.AtomicReference, which is what an atom instances, in Clojure.
4:49:16
shka_
beach: well, i don't think that i have, that's true. Everything i do comes from my inner needs, not hope to actually change anything.
4:49:39
flavio81
so clojure is tarnished with Java down to the nomenclature; there are even things that should be in a Clojure "Standard Library", to put it in some way, but they aren't: you need to invoke a java method.
4:51:37
flavio81
lambdice: i have programmed in java in the past, professionally for about 3 years; for me, java is repression and Lisp is the opposite extreme; to program in Lisp but still have to submit to calling java functions for TRIVIAL things, is a bit like having to deal with the mafia. It feels dirty. I think it's great that one can call java from Clojure
4:51:37
flavio81
easily. However, i don't like when this is used to do things that should be built into the language stdlib in the first place.
4:53:25
lambdice
borei: humm not sure if it could help if it is a little snipet you can try to run directly with from C and see if the can find the same bug
4:55:47
flavio81
lambdice: i can bet i'm not the first to say something similar. I've not met any experienced developer that liked Java.
4:57:23
lambdice
flavio81: i have found for me that learning the theory of lisp, core of the language, is so easy, but the practice is so hard like packaging, tools, library
4:57:29
flavio81
lambdice: i mean, i respect the JVM and it's speed, and the huge amount of libs. But compared to Lisps (plural), it's a low level language where macros are implemented by humans sitting at the desk like monkeys and spitting out tons of boilerplate code (usually to apply some "design patterns" to supply things that the language doesn't allow)
4:58:23
lambdice
flavio81: well yeah defpackage, asdf and also creating application bundle for end user for example
4:58:37
flavio81
lambdice: in my workplace we had several Java Macro Processors, they were named Javier, Giancarlo, Flavio, etc... and paid monthly
5:00:14
flavio81
lambdice: which are named "namespaces" in C# and Clojure. Namespaces make your symbol names don't collide as long they are... in separate namespaces !
5:00:51
aeth
I think a lot of the problems with Java aren't Java the language but Java the idioms and culture.
5:01:20
flavio81
lambdice: ASDF allows you to define "systems", a system is a collection of files where you specify which file depends on which, etc. So the system can be compiled as a whole. Of course, those files will probably do stuff inside their own namespaces (one per file) so symbols don't collide. It's up to the programmer.
5:01:24
aeth
There's not much stopping you from writing decent code in Java, it's just not the culture of Java
5:02:17
flavio81
lambdice: then you have quicklisp which is a tool that allows you to easily fetch "Systems" from The Internets, compile them, and have them ready to eat at your machine
5:03:44
flavio81
aeth: me and my friends wrote decent java code for years, and when you look at it from a Lisp perspective, that decent code was too long, too repetitive, and could have been implemented in far less time with a more powerful language. In other words, yes, nothing stops you from writing decent code in java. Also, nothing stops you from writing decent
5:03:51
borei
honestly saying, i found that quicklisp is a bit dangerous tool for beginer lisper - too many thinks are happening under the hood
5:04:34
aeth
flavio81: give me assembler with s-expressions and a powerful enough macro system and I'd prefer it to half of the programming languages, probably.
5:04:56
flavio81
lambdice: it's simple, just learn how to defpackage first, then how to define your system (and then compile it using the suitable asdf function)
5:06:00
flavio81
aeth: Yes, agree. And assembler has that rare quality (think Lisp) where the code is data -- at the end, machine language is computer words. You can do self-modifying code, etc.
5:06:22
lambdice
flavio81: i defpackage, i made nice system, i downloaded sdl2 from quicklisp, i have the best game of the world!! how can i share it with my friend ?
5:07:10
flavio81
lambdice: you upload your project into Github (or in a ZIP file or in a .tar file, etc); and make sure to include the system definition file (.asdf)
5:08:17
flavio81
lambdice: no no, in the ASDF, using :depends, you specify the libs that your "system" depends on
5:08:53
flavio81
then your friend can download the zip file you're giving him/her; and then he/she uses quicklisp to give quicklisp the task of locating those dependencies, downloading them, and then compiling your system
5:09:47
flavio81
lambdice: well... if you want to make things happy for him/her, yes. He/she still can just download the dependencies by hand and forget about quicklisp !!
5:11:11
borei
it (quicklisp) installed all dependecies, so i completely lost what i have and what versions
5:12:08
borei
once you are experienced lisp programmer familiar with eco-system - then quicklisp is very powerfull tool
5:13:24
borei
inetersting with opengl - my first test was for mesh 100x100, it took .64 secodns to load all vertices approx 30k floats
5:17:28
basket
It's a pretty minor complaint but the terminology in Clojure is the worst UX part of it for me. There's atoms, but they're not what Lisp calls atoms, there's an operator/type called cons, but it's not what Lisp calls cons, there's an operator called do but it's not a looping construct, and so on. It just makes for so much friction trying to use it
5:19:15
flavio81
basket: exactly; even more, exactly what i posted some minutes ago. I really got a bit angry with Clojure use of the "atom" word
5:19:40
flavio81
basket: also "ref" ... a bit silly, a bit silly terminology overall, to do things like transactions using STM
5:20:12
basket
I'm pretty sure about the second thing I ever typed into a Clojure REPL was (cons 1 2), what a terrible first impression
5:20:45
flavio81
basket: i felt like... how about calling things like "perform-transaction" or "do-atomically" ?
5:21:40
lambdice
what is your stategy when you are coding you own project, you put a symlink of your asd file into the default directory asdf:*central-registry* or you add your project directory in asdf:*central-registry* and let your asd in your project directory
5:23:30
aeth
Common Lisp, Scheme, and Emacs Lisp are the only Lisps that feel like they actually do things the Lisp way.
5:23:51
aeth
So many newer Lisps go out of their way to either be different or to miss the point completely.
5:24:07
flavio81
lambdice: i'm a lazy guy, i put my projects on what the default central registry dir was... and stopped worrying. But you can define where do you want your central registry.
5:27:09
flavio81
lambdice: i don't think a symlink of the .asd file would work. I think you'll have to symlink the whole directory containing the asd file (and the rest of your files)
5:29:48
pjb
flavio81: once upon a time symlinks to the .asd worked, I see no reason why it should not still work.
5:35:10
ahungry
if you have a custom project directory, adding something like (pushnew #P"/your/path/here" ql:*local-project-directories*) is useful to include in ~/.sbclrc (assuming you're an SBCL user)
5:38:44
pjb
flavio81: that said, since quicklisp is able to scan directories automatically, it's better nowadays to symlink directories in ~/quicklisp/local-projects/
5:39:32
pjb
symlinking asd files was good when we used asdf directly, simplier than pushing lots of directories on asdf:*central-registry*…
5:41:04
flavio81
lambdice: you can use asdf to compile systems... you can also use quicklisp to load and compile systems; because quicklisp uses asdf too
5:41:11
whoman
fwiw, something that tricked me up a little, was putting defpackage in package.lisp, which the .asd components includes. it may sound abstract but it solved my initial anxiety with asdf
5:43:22
lambdice
whoman: someone on this chan linked me this http://davazp.net/2014/11/26/modern-library-with-asdf-and-package-inferred-system.html
5:45:48
lambdice
yeah i read about just a bit about this, but i would like to understand first how all these things works
5:46:44
flavio81
lambdice: the link looks as an interesting way to define your system, but too much black magic for me
5:48:50
flavio81
lambdice: just start with putting each of your files in its own package (i'd guess this is just a Good Practice), and then creating your .asd; it's basically as simple as that
5:50:40
flavio81
whoman: yes, everybody gets nostalgic about them, however remember that in 2017 we don't need any special expensive hardware nor paying expensive licenses to have Lisp running at blazing speed in our machines. So 2017 is better than the 80s or 70s, i'd say, even if Genera is more powerful than Emacs with SLIME.
5:50:50
whoman
most projects dont need to be systems aside from makefile collections of packages, i believe, where packages are normal human-sized nuggets
5:50:56
pjb
whoman: here are your 1968 hippies: https://chessprogramming.wikispaces.com/file/view/JohnMcCarthy.jpg/398712454/JohnMcCarthy.jpg https://www.princeton.edu/~blogs/archive/aspire/computingFOU17.jpg
5:51:28
flavio81
whoman: things like SBCL are a godsend; i mean, a CL compiler with (optional) static type checks, that generates very fast code, for FREE you say? I'll take two !
5:51:36
whoman
systems more so in the times of changesets inside the lisp images like how smalltalk does versioning and patches. cant be sure aside from knowing the history would help to understand more of everything too beyond asdf lambdice
5:52:26
whoman
it took a long time to set up those selfies. sometimes weeks in advance. photos were quite a big deal back then, remember.
5:54:32
whoman
https://d28dwf34zswvrl.cloudfront.net/wp-content/uploads/2017/08/Richard_Stallman-CC.jpg oh well i guess now
5:56:09
flavio81
shka_: so the world ended up using operating systems that follow the UNIX paradigm rather than the Lisp Machine paradigm
5:59:27
lambdice
well this is a bit cryptic for me.. do we need a special kind of hardware for running an operating system using the lisp machine paradigm?
5:59:52
beach
flavio81: That is one of the most gutsy decisions I have ever seen. If it had been me, I would have chosen the Lisp route, and then failed miserably because people would not go for it. By choosing a mediocre but popular design, RMS changed the world of computing.
6:00:23
flavio81
beach: Agree 100%. Do you think this has been caused by his in-fighting between the two major Lisp Machine companies?
6:00:55
beach
flavio81: No, I just think he is way smarter than most of us. Certainly way smarter than I am.
6:01:21
flavio81
Zhivago: not only processes, also the way the information is shared between application. Unix is mostly sharing text-file or binary (multiple formats) info between processes through pipes or files. This information would better be shared in the form of s-expressions.
6:02:07
flavio81
beach: Smarter as in "steve jobs is smart"? (that is, smart at marketing shit as chocolate, smart regarding distorting the reality for your own purposes) ?
6:03:08
flavio81
Zhivago: they can be represented internally as you want, but the applications should share (and see) s-expressions. We're partly there, curiously, with JSON and APIs; at the end all these mostly interchange information through JSON structures.
6:03:39
Zhivago
flavio: So, what's the issue with sharing text or binary data between processes, then?
6:04:09
pjb
Next time you see RMS in a conference, ask him why he choose to re-implement unix instead of lisp machines. We'd have GNLM instead of GNU :-)
6:05:12
pjb
Zhivago: you have to deserialize them. For an example of shared memory S-exp communication, see com.informatimago.common-lisp.heap.heap
6:05:40
pjb
Zhivago: but then, with com.informatimago.common-lisp.heap.heap we also copy the S-exp between the shared heap, and the native lisp objects…
6:06:10
pjb
Zhivago: for same-implementation communication, one could make a patch to an implementation to be able to move lisp object to a shared area.
6:07:54
pjb
With the number of conference and his celebrity, I wouldn't be surprised if RMS has been in the same room as a majority of programmers having written or contributed to at least one free software.
6:08:03
flavio81
Zhivago: so if information is exchanged between applications as s-expressions, they are uniform; they can be leveraged by any application (potentially); they will be understood by the OS as well, and they can be even shared by more than one application without requiring it to be copied from process to process
6:09:11
aeth
Each Lisp language (and some things that aren't Lisps) has its own definition, sometimes very different.
6:09:17
flavio81
pjb: what about software under GNU license model but running on .NET CLI/CLR runtime ?
6:09:49
Zhivago
flavio: Sure, but there's no obstacle to sharing information structured as s-expressions in the form of text or binary data between processes.
6:11:22
flavio81
Zhivago: yes, there's no obstacle. However, the OS ought to handle serialization to binary data; why should applications do it?
6:12:48
flavio81
pjb: whenever you mention "Real Programmers", i'm tempted to reply: "Real Programmers write FORTRAN in any language". "Real Programmers don't use Pascal" and "Real programmers don't write comments: The code is obvious"
6:13:33
Zhivago
flavio: Presumably what you mean is that the message sending interface should do it. Why does it matter where that's implemented?
6:16:57
Zhivago
flavio: I still think that the only fundamental difference between the models is that posix provides multiple virtual machines, and the LMs didn't.
6:18:59
flavio81
Zhivago: i'll leave beach to reply, he's far far far far more qualified on these topics
6:21:07
flavio81
pjb: look what you've done... now i'm thinking about watching the whole movie again
6:30:25
flavio81
lambdice: also other (very different) alternatives like EQL which is the ECL lisp implementation talking to the QT toolkit
6:46:12
p_l
flavio81: if you want a mutually-understandable data model between OS components, then S-Expressions aren't the choice (as they are to-disk serialization format), but something akin to VMS ABI with its declared common data type library, or CLR/JVM/<Smalltalk VMs>/Lisp-Machine kind where you have high-level constructs embedded in the "VM" the processes run
6:47:55
jack_rabbit
although, some operating systems have been very successful with a to-disk-able data-passing model.
6:58:26
Zhivago
Unless you want to be comparing strings you probably want to reduce that down to a nice integerish form.
7:01:44
Zhivago
On the other hand, they're also very big and it might be expensive to try to share a jpg that way.
7:07:43
flavio81
jack_rabbit: what's silly is having an OS that only understand and deals with byte-streams at the core level, unlike Lisp Machines
7:10:08
Zhivago
Perhaps it might be useful to clarify what 'core level' means. In posix systems, I would say that only the periphery deals with byte-streams.
7:11:26
jack_rabbit
I don't know of a single POSIX interface where the client communicates with the OS using a byte-stream.
7:12:56
Zhivago
Would you consider writing to a socket to be communicating with the OS using a byte-stream?
7:14:23
flavio81
Zhivago: what I mean is, the OS does not implement facilities for dealing with structured data; thus the applications need to implement them in diverse, differing ways. What i claim is that the OS should also provide services for structured data and interchange such structured data between applications, as part of the services provided by the OS.
7:17:13
Zhivago
But it sounds like what you really want is for the OS to prevent communication except via your preferred schema?
7:17:46
Zhivago
(Since it's always possible for applications to communicate structured data over byte sequences)
7:19:06
flavio81
jack_rabbit: That is "manipulating a byte-stream" if you consider that writing Lisp is "manipulating machine language"
7:20:40
flavio81
jack_rabbit, Zhivago: My point is clear: the OS should support a common *structured data*, *standarized* format, giving functions for doing diverse operations with this format, *at a core level* (that is, operations supplied by the OS). This is the only thing I suggest.
7:21:08
Zhivago
If you don't want the OS to enforce it, then this is purely an issue of a consensus between applications.
7:21:44
Zhivago
In which case, you should think carefully about why you think this is an OS level issue rather than a library-and-education issue.
7:22:46
flavio81
Zhivago: i think it's simply that you prefer your OS to stay as low-level as possible, and i don't. It's a philosophical issue, i think.
7:23:05
jack_rabbit
Zhivago, They've tried educating. It doesn't work. People still do different things than what they think they should do.
7:24:33
Zhivago
flavio: Either the OS enforces the schema, or it is a matter of consensus between applications.