freenode/#lisp - IRC Chatlog
Search
2:05:50
aeth
The only Lisps I know that have users are Common Lisp, Scheme (and Racket if you count it separately), and Clojure.
2:06:43
mr_yogurt
i guess the question then becomes which of those three is closest to common lisp, then
2:07:45
aeth
There are a bunch of minor, barely-alive Lisps, but they're mostly "hey, let's express <language> in s-expressions"
2:17:55
aeth
The problem with Lisps is that it's really easy to make your own, but really hard for it to be more useful than Common Lisp.
2:23:52
Petit_Dejeuner
mr_yogurt: You can do this without shadowing your functions (let ((max (max stuff)) (length (length other-stuff))) ...)
2:23:52
minion
Petit_Dejeuner, memo from pjb: re-indent the Common Lisp from your programming language class to make it pretty!
2:25:14
Petit_Dejeuner
It turns out it's pretty convenient to not have to think of a new name and which is which is pretty obvious from context.
2:25:37
aeth
mr_yogurt: One way to avoid name collisions would be to use many packages instead of one core CL package. But CL doesn't do this.
2:27:06
aeth
You can have a type foo defined by the function foo, and give it the variable name foo when you use it.
2:29:14
aeth
and when you have name collisions you have to keep the scope in your head. Maybe it's okay to call something list locally if you're not going to call the function list, but then you have to be aware of that
2:29:55
Petit_Dejeuner
ACTION doesn't really notice one being significantly better than the other. Lisp-1 is more elegant, but lisp-2 is more practical.
2:30:18
aeth
On the other side of the argument, you can just do things like (mapcar + (list 1 2 3)) or (lambda (x) (x 42)) if it's a lisp-1
2:32:52
aeth
(let ((foo (foo 42))) (declare (foo foo)) ...) is actually a quite elegant thing you can do with multiple namespaces
2:37:38
Petit_Dejeuner
That's one of the things that annoys me about Racket. The types are in the same namespace as everything else.
2:38:02
pjb
mr_yogurt: why don't you just read http://www.nhplace.com/kent/Papers/Technical-Issues.html instead of bothering us with those sterile questions?
2:39:35
Petit_Dejeuner
I'm pretty sure I've gotten a bug before because I used muh-record as a variable name and then tried to use match with muh-record.
2:42:44
aeth
just like there's a *read-default-float-format*, why not have a *lisp-n* and settle the debate forever? :-p
2:53:49
aeth
Petit_Dejeuner: immutability vs. mutability, higher order functions vs. equivalent macros, compile time vs. runtime, dynamic vs. static, typed vs. untyped, etc.
2:56:37
jasom
does anybody know if cl-autowrap works with C++? I know c2ffi does, but it's unclear to me if cl-autowrap can do anything with c2ffi's output from cl-autowrap
2:58:39
aeth
well, probably no optimization in the standard Python implementation, which is one of the slowest languages that's not compiled to that machine that runs in Game of Life
2:59:53
aeth
Pretty much two things from python would be cool. sequence comprehensions (because list comprehensions just aren't good enough) and tuples/named tuples.
3:00:13
aeth
I say sequence comprehensions because that would be the CL-idiomatic way to do it, support both common sequence types
3:00:33
pjb
Notice how CLHS doesn't say symbol names are not mutable, but that it's not conforming to mutate them!
3:01:33
Petit_Dejeuner
aeth: There's no standard way to represent sequences in Common Lisp, is there?
3:02:14
aeth
There's also no standard accessor to indexable things, although elt is generic over sequences.
3:02:47
Petit_Dejeuner
It wouldn't be hard to write a loop that generates sequences if there was a standard sequence to generate.
3:03:49
Petit_Dejeuner
aeth: Not really much to do about it. There aren't any other standardized high level languages with several compilers.
3:04:01
aeth
pjb: You can add anything to any language, but some things require compiler support to be added efficiently unless the language is as basic as C
3:05:26
pjb
You can't rely on CL compiler macros since they're not necessarily used. You have to implement your own with macros, if you need them.
3:07:00
Petit_Dejeuner
I don't even think it's an implementation problem. If you extend too much, you have to write a new standard.
3:07:58
pjb
No. A new documentation. Standards are processes involving a lot of resources and people. That's the point: you can make your lisp evolve without a standard.
3:08:08
Petit_Dejeuner
Once you start writing replacements for things like 'defun', 'defvar' 'defclass', and 'let', the language stops being Common Lisp.
3:09:16
Petit_Dejeuner
Yeah, but the language is also the conventions and idioms the programmers know. If the language changes too much, then those no longer apply.
3:14:50
Petit_Dejeuner
The worry is that if you extend a language through the language to the point where you start masking or replacing built-ins, then your language starts to stop working well with other code.
3:15:31
Petit_Dejeuner
It'll work, but the core benefits won't extend to code that's written closer to the base language.
3:16:33
pjb
When you add your bills, that doesn't prevent you to use the same mathematical language to compute black hole structures.
3:16:39
Petit_Dejeuner
I can write a lazy sequence object and replace loop and other constructs with versions that can support lazy sequences, but people who aren't using my library won't create libraries that support it unless I'm really clever with how I shadow the standard values.
3:17:49
aeth
Iirc, someone here is writing a library that has type-generics rather than class-generics. It's only portable to a handful of implementations.
3:17:56
Petit_Dejeuner
Tokenizer and parser are working. Now I can just play with Lisp in Small Parts.
3:18:16
aeth
But, anyway, you'd need a lot more control over efficiently abstracting over types in order to heavily customize CL
3:20:45
Petit_Dejeuner
imho, common lisp doesn't need to be extended all that much to be better than a great many other languages
3:20:53
Zhivago
petit: CL was designed as a compatibility layer, like posix, rather than as a fundamental language.
3:21:41
jasom
Zhivago: not quite; the working group added a *lot* of features that didn't exist already
3:22:13
aeth
You can define languages that compile to CL and CL is almost an acceptable multi-language environment, sort of like Racket's philosophy.
3:22:52
jasom
CLOS was strongly based upon flavours and common loops, but was a new thing. I don't know that any existing lisp used lexical bindings before they were introduced, but could be wrong about that one
3:23:22
Zhivago
I'm not saying that it was purely a compatibility layer, but that that's the direction that CL was introduced from.
3:24:24
aeth
One key thing that CL is missing is additional read-time, compile-time, macro-expansion-time, etc., power.
3:26:05
aeth
The current trend in programming languages is catching mistakes before the program has even run.
3:27:14
aeth
Someone would have to do a lot of work determining the minmium number of additions necessary at the implementation level (where everything else can be added by libraries)
3:28:13
aeth
What elements of pattern matching cannot be efficiently implemented in a portable CL library?
3:32:00
aeth
On the one hand, you have channels like this. On the other hand, you have #emacs where the topic is anything but Emacs.
3:35:00
whyNOP
rofl that's what i was thinking...except the rule is Emacs comes first, and all other chatter should be dropped in favour. it's a good system. sorry to be off-topic btw if that's a hard rule. i just wanted to observe this.
4:21:26
vtomole
What is the algorithm to parse sexprs? Some type of recursive decent? I don't know how to handle nested parentheses.
4:26:21
Petit_Dejeuner
You make a recursive call each time you get an open paren and return a sexpr each time you hit a closing paren.
4:32:27
beach
jasom: Not sure whether you are talking about lexical scope when you say "lexical binding", but Maclisp used lexical scope in the compiler (but not in the interpreter). And the use of lexical scope in Common Lisp was inspired by Scheme, that came before Common Lisp.
5:07:46
jmercouris
let's say I have a defclass, how can I use some of the args I define, in a later variable
5:08:13
jmercouris
for example given: https://pastebin.com/DvirDDsk, how could I reuse history-active-node in another argument
5:18:21
beach
jmercouris: Just use the accessor. The :accessor slot option automatically defines a method.
5:20:14
jmercouris
I have a a slot in a defclass, I want to use the value of the first slot, in a later slot
5:20:17
beach
"how can I use some of the args I define" does not make sense, because you are not defining any args.
5:20:25
pjb
jmercouris: consider a method of the initialize-instance or the shared-initialize generic functions.
5:20:47
beach
"how can I reuse history-active-node in another argument" does not make sense either, since they are not arguments.
5:22:45
jmercouris
so much re-architecture work to do as I learn more about lisp, I keep looking back at my code and shaking my head lol
5:25:54
loke
ACTION went to look for a new refrigerator recently, and the power consumption was written as kWh/year
5:26:58
beach
I often hear that this or that power plant produces so and so many Mega-Watt.... each day.
5:27:28
jmercouris
I was getting a segfault unless I put my variable into a parent let, any idea why that is?
5:27:29
pjb
jmercouris: but really, you should consider using the initialize-instance generic function, instead of some random generic function of yours.
5:28:03
beach
jmercouris: You should not get a segment fault, or you are using a low safety value, or a bad implementation, or both.
5:28:19
pjb
jmercouris: Unless you have to initialize a graph of instances. In that case you may need your own method to create the instances and hook them together.
5:28:43
jmercouris
I'll read more about clos and make things tidy, but I'm still learning and it's nice to have some code to refactor
5:31:04
jmercouris
iqubic: well, it's not exctly the epitome of stable, and it doesn't compile either, you can only load it
5:31:52
beach
jmercouris: If you had indented it correctly, it would have been easier to see the problem.
5:32:36
beach
jmercouris: It looks to me like you are using the variable ROOT in defining the variable MODE. You can't do that with a LET. It has to be a LET*.
5:32:47
iqubic
jmercouris: I was referring to the browser. Do you have to run the browser through a repl?
5:35:37
beach
jmercouris: I agree with pjb in that it is a very bad idea to use foreign code while trying to learn about Common Lisp.
5:36:33
beach
jmercouris: I am just telling you why it may be hard to help you. So you might find yourself on your own in many situations.
5:37:02
jmercouris
I appreciate the heads up, I am trying as much as possible to disentangle the two in the code
5:37:19
loke
ACTION has a couple of CFFI-using libraries on QL. The goal is to make them stable and fool-proof so that external users of the library will never have a problem. That is very hard.
5:37:47
loke
Getting it to work is easy. Making sure that it's stable in the face of all kinds of errors is another ballgame. I can't even imagine wrapping a GUI library.
5:37:48
pjb
jmercouris: one way is to separate the UI from the core, running them in different processes, communicating thru pipes or sockets.
5:38:41
jmercouris
iqubic: https://github.com/nEXT-Browser/nEXT/tree/master/next#002 version 0.01 is done, and workign on finishing 0.02
5:39:06
pjb
jmercouris: Then the lisp side is in pure lisp, and the other side can be in whatever, java, C++, we don't care if it crashes…
5:39:40
pjb
If it crashes, the socket is closed, and you can just relaunch the UI and re-open a new socket.
5:40:37
jmercouris
beach: also, the indentation from emacs gets ruined in pastebin for some reason, I just looked and is indented right on my screen
5:41:24
jmercouris
pjb: I'll have to think about that, maybe I can use threads at the least, to be clear QT crashing doesn't result in a complete failure of my program, the REPL still works...
5:42:10
loke
jmercouris: For some value of “work”. The problem si that ytou've placed the runtime in an inconsistent state and anything could happen.
5:46:30
loke
jmercouris: It's almost impossible to recover frm a SEGV. There are thousands of different things that could have happened that triggered it. Most of which involves corrupt data in memory. Even if you keep running after the SEGV the corrupt data is still there, waiting to surface.
5:47:37
jmercouris
loke: not exactly, it depends on whether that corrupt memory is a part of same thread, and your kernels' memory model
5:48:45
jmercouris
there's a lot of factors here, I don't think it's fair to say that SEGV means corrupt data waiting to surface
5:49:13
loke
jmercouris: How would you know? Once the SGV happened you have to assume that the state is corrupt.
5:50:25
Zhivago
You can recover by causing the address that faulted to be on an appropriately permissioned page and returning.
5:50:57
loke
Zhivago: Of course. I almost typed exactly that in my previous statement, but I figured it wasn't important.
5:52:05
jmercouris
I would disagree with that, we're making many assumptions about how the OS operates here
5:52:45
loke
jmercouris: You are the one making the assumptions... Mine (and others?) position is that you can't make any assumptions at all, hence you have to distrust the entire process.
5:52:47
jmercouris
what if the different processes are on different machines? what if it is a distributed system?
6:34:58
jmercouris
how can I know that what I am looking at on github https://github.com/oconnore/queues is the same thing?
6:35:23
jmercouris
specifically this line; #<system queues.simple-queue / queues-20170124-git / quicklisp 2017-04-03>