freenode/#lisp - IRC Chatlog
Search
10:03:25
MichaelRaskin
The AST nodes are just records, and you have quasiquotes, and you are expected to use records for everything in the normal code, too.
10:04:46
no-defun-allowed
I do intend to implement homoiconicity in my toy language. There's quote syntax, and my CL generator generates code to generate the objects (though this should be a literal value).
10:05:32
no-defun-allowed
However, I'm not sure how macros fit in a Smalltalk like language. My impression was that changed order of evaluation was made very clear using lambdas. Anyways, back to CL?
10:06:47
bonz060
no-defun-allowed: You are plunging into language design? How did ya get into that universe?
10:07:04
ggole
MichaelRaskin: you can encode the AST for a language in almost any language, but usually you need special purpose structures (like a set of record types or an ADT or something)
10:08:12
no-defun-allowed
bonz060: boredom, and also there had better be teaching languages better than Python.
10:09:24
MichaelRaskin
ggole: but what if ADTs _are_ the go-to types of choice for normal code, too?
10:10:26
no-defun-allowed
The only better language that is fit for learning is Racket with Swindle (or is it just Swindle?). I don't mean to poke at CL, but it is sometimes quite arbitrary, and I think it hinders learning from nothing.
10:10:28
ggole
eg, in OCaml, the expression 1 + 1 is quite different from BinOp(Add, Int 1, Int 1) (or whatever)
10:10:30
bonz060
no-defun-allowed: The way some people in me life are big python fan-bois woOt woOt. But to be fair, python gets work done quickly. And it has a vibrant community. I get paid to write python code. And I try to make it as idiomatic as it can get :) :)
10:12:56
bonz060
no-defun-allowed: Haskellers make the same argument for Haskell. I figure, just be curious. Suspend judgement until you know enough to be dangerous with said language... then you can air them opinions, from an objective pov.
10:15:17
no-defun-allowed
bonz060: I go to school and I try to blurt out two hours' worth of Python, and hit a metaphorical wall. It's a significant drop of productivity from my SLIME padded cell.
10:16:09
no-defun-allowed
Not to say I can't work in Python, I'm pretty good at it, but it's a very big drop in productivity.
10:22:34
no-defun-allowed
So, I have pretty close to 5 years of experience in Python, and I've found after 1.5 in CL I'm more productive in Lisp. What does that say about Python?
10:29:45
no-defun-allowed
(You can probably scrape off a year or two off learning one programming language after you know another, but that's a third of the time!)
10:30:27
no-defun-allowed
The only alternatives I knew of were C++, Java and Haskell, and none of those looked great to me.
10:31:10
no-defun-allowed
Of course, you can almost make an alphabet-teaching list using programming language names, but not every language is promoted equally.
10:35:57
bonz060
no-defun-allowed: What made python for you unproductive? Do you think other people would share your opinion if they moved to CL? Personally, I'm looking into CL because of some sense of deep intellectual curiosity that is constantly being fired up at meet-ups and sometimes at work(when someone goes on a rant on how they wished one of our stack was in some form of lisp)
10:37:24
bonz060
no-defun-allowed: Since you've been using CL for 1.5 years, what was your learning path?
10:38:12
no-defun-allowed
The interactive REPL/SLIME interface is pretty much why I stuck around, since it gets you out of the slow run-fix-restart loop.
10:39:00
no-defun-allowed
Common Lisp is pretty dynamic and utilises a lot of late binding to redefine classes and functions at runtime.
10:39:54
verisimilitude
Common Lisp is more dynamic than Python, but also more efficient, bonz060, in addition to having a standard with multiple implementations.
10:41:59
no-defun-allowed
Yeah, CL is also much much much faster, somewhere around 1.5 to 3 magnitudes usually.
10:43:24
akater
What is the point of quicklisp-slime-helper? It creates a config potentially duplicating and potentially contradicting init.el, and it depends on alexandria. I don't see how it's useful at all.
10:44:55
akater
A newcomer is eager to use it, and I just don't think it's a good idea which is weird since Xach made it (?).
10:45:17
no-defun-allowed
But, if the moon is positioned correctly, it works well enough to get SLIME running for a while.
10:47:01
akater
bonz060: Arguably, every Lisp user is into language design. “In Lisp, you don't just solve a problem, you write a sublanguage to solve it in.”
10:47:24
no-defun-allowed
Yeah, SLIME is pretty damn good, I think only Interlisp and a few Smalltalk IDEs compare.
10:48:26
no-defun-allowed
Though, the language I designed isn't a Lisp, since I already wrote a transpiler for a friend's Lisp-lookalike and it wasn't very exciting.
10:48:29
verisimilitude
If you're just starting out, this is one of the only things CLISP is good for.
10:49:50
bonz060
akater: Why is language design so intriguing? As far as I'm concerned(at least for me), I want to get shit done in a way that I won't hate myself 2 weeks from now. I also get that "language design" vibe from some hard core haskellers. What's so fascinating about language design?
10:50:34
no-defun-allowed
CLISP is the best out of the box, yeah. Fun fact: CLISP was freed after an argument between the developer and RMS about licensing on readline.
10:50:45
akater
bonz060: My point is, in Lisp people tend to do it not because it's fascinating but because it's natural in their workflow.
10:51:11
verisimilitude
I'm familiar with it, yes, no-defun-allowed; interestingly, it's not mentioned by name when it's mentioned that putting unique libraries under the GPL resulted in at least one program being released under the GPL.
10:51:34
no-defun-allowed
Macros make it pretty simple for simple changes, and code walking (except for arbitrary CL, ironically) is trivial in Lisp.
10:51:55
akater
bonz060: but yes, everything becomes intriguing and fascinating once you get productive with it.
10:52:26
no-defun-allowed
ACTION is now going to sleep, please defer questions to someone who isn't half asleep thanks (:
12:33:42
aeth
verisimilitude: I wouldn't say that CL is more dynamic than Python. Common Lisp can be dynamic, and it can be not particularly dynamic, and really, quite the opposite of it if you hardcode everything in one giant macro that generates one function.
12:46:37
p_l
I'd say CL is less dynamic than Python, but that's related to obscure details of implementation in Python
12:47:06
p_l
you can program in similar style in CL, but it's very old and low-efficiency in terms of speed way
12:48:21
p_l
no-defun-allowed: funnily enough, RMS position is afaik not necessarily defended by GPL
13:37:02
MichaelRaskin
Hm. Can I submit a task in lparallel without creating a new anonymous function per task? Or what is recommended to use if I want to submit a lot of tasks with the same function and different arguments?
13:40:14
MichaelRaskin
Indeed; but submit-task definition refers to task-lambda which creates a new function via flet
13:42:03
_death
so you have an answer to your question ;) .. do you think it would be worth it to separate the context?
13:44:04
MichaelRaskin
I don't hae the answer to my complete question — what can I use for a thread pool without anonymous function per task
13:52:20
_death
lparallel also exposes a queue interface and implementations, but I don't recall them being too clever
13:57:21
Grue`
MichaelRaskin: you can have a bunch of workers per thread and each of them would grab args from queue and run your function in a loop
14:02:24
MichaelRaskin
Although maybe I am too pessimistic and my tasks (which write some files, and often spawn external programs) are not that cheap…
14:19:46
MichaelRaskin
I want the sum total of worker threads CPU share be larger than the main thread CPU share
14:40:07
White_Flame
the vast majority of allocations are just a pointer bump & range check, without even a function call
14:40:55
MichaelRaskin
Now I am trying to see if something can lock and force effectively single-threading operation
17:00:43
puchacz
what's the difference between handler-bind with binding for error as type vs t as type?
17:04:05
puchacz
and for "production", I think I should have t not error for graceful handling, i.e. showing the user "internal error" page rather than crashing sbcl, right?
17:05:22
puchacz
if I do not bind for something that is not an error but a different type of condition, will it crash sbcl?
17:07:43
puchacz
yeah, it sounds pejorative, I realise it is a reasonable behaviour, if I intentionally remove debugger, what else should it do rather than quitting?
17:07:59
jackdaniel
(timeout is not an error, still a serious-condition, same goes for out of memory conditions)
17:12:24
puchacz
and I quit it manually when it happens in dev computer, because I don't know how to use it :)
17:40:59
slaterr
I had a lot of fun writing a tiny html dsl in haskell. end result: https://bpaste.net/show/bad4ef1239ed
18:16:16
fiddlerwoaroof
But, since there's not really any way to recover once you enter it, it's never been very useful for me
18:16:58
fiddlerwoaroof
Now, if you could tell it to resize the dynamic space and continue, or something, it might be useful when you accidentally read in a huge file or something
18:35:14
drewc
ldb can be quite useful when trying to track down things that require it. For me, it was UCS-2 + Oracle + C + sockets + SBCL with the new UNICODE string encoding. That was the one time I have ever needed it, and it was quite literally tracking bits and bytes after crashes.
18:40:18
pjb
comborico1611: the repl can use any implementation strategy to evaluate the expressions.
18:41:02
comborico1611
I am able to LOAD the source code, but when trying to LOAD the compiled (fasl) file, I get an error.
18:52:43
comborico1611
Is there a special term for assigning a value to a global variable by calling a function whose lamda list contains that global value?
18:59:45
pjb
comborico1611: there's no difference between a parameter binding (lambda list) and a local variable binding in a LET, LET*, PROGV or PROG.
19:01:01
pjb
More precisely, there are other languages where the bindings are dynamic, but few of them. Mostly by accident.
19:02:34
pjb
But in most languages, there's no difference between a parameter and a local variable: even a input parameter (by-value), you can usually assign to it: int f(int a){ a=2; return a; } f(3) -> 2
19:09:58
Grue`
comborico1611: I'm not sure what "lambda list contains that global value" means. if you're passing the value to function changing it won't change the value of the global variable unless you mutate it
19:10:26
comborico1611
How would I access the individual add-list access functions? https://pastebin.com/9N8kNVXd
19:11:37
comborico1611
Grue`: Example: (defun bob (value *global-variable*) (BODY)) So calling (bob 2 'barker) would set global variable to barker.
19:12:28
pjb
comborico1611: in that cas, value is a normal lexical binding, as long as value is not a special variable.
19:12:59
pjb
comborico1611: but *global-variable*, assuming it's a special variable will be dynamically bound.
19:13:22
Grue`
comborico1611: it won't set *global-variable* to barker because it creates a new scope
19:21:53
pjb
A single symbol can be used to name a variable (multiple variables actually), zero, one or more functions, but also other things, such as types, classes, tags, slots, etc.
19:23:33
pjb
(mapcar 'funcall (flet ((foo () 1)) (cons (function foo) (flet ((foo () 2)) (cons (function foo) (flet ((foo () 3)) (list (function foo)))))))) #| --> (1 2 3) |#
19:24:03
pjb
There are really 3 different variables, and they have the same name. Only they are not accessible in the same scope.
19:25:55
pjb
(defclass foo () ((foo :initform 4))) (block foo (flet ((foo () 1)) (let ((foo 2)) (tagbody (go foo) hello foo (return-from foo (list (foo) foo (find-class 'foo) (slot-value (make-instance 'foo) 'foo))))))) #| --> (1 2 #<standard-class foo> 4) |#
19:26:21
pjb
There can be no overloading since foo is used to name different things, in different namespaces.
19:44:30
comborico1611
The main source of my current confusion is here. https://pastebin.com/hEJqdvXA
19:45:34
comborico1611
The author writes as if the accessor functions are implicitly defined from the subsequent creation of the structure.
19:49:21
buffergn0me
comborico1611: Indeed the accessors are defined by defstruct. How are you trying to run the code?
19:49:35
_death
you can see for yourself with (macroexpand-1 '(defstruct op action preconds add-list del-list))
19:59:04
comborico1611
Very annoying -- I don't know why I must retype type the quote marks. But for some reason, I must retype them. I was going to run the code directly from book. (I changed names of things for my understanding.)
19:59:58
comborico1611
buffergn0me: Here is the full program. But quotes are not registering correct on my Emacs. https://pastebin.com/qE19McPf
20:02:38
buffergn0me
comborico1611: Some program is "helpfully" replacing regular quotes with Unicode smart quotes
20:18:34
comborico1611
I got it to work! Now to figure out where things went wrong. Thanks everyone for help.
20:57:18
comborico1611
I believe the problem was I had the function definition too far down in code. I didn't realize that was an issue.
21:13:26
Josh_2
Parenscript is used to generate JS functions which can be written to files called .js files right?
21:17:06
buffergn0me
Josh_2: You can do that. Also generate the JS dynamically and serve it from a URI handler, or put it into inline <script> tags
21:17:55
Josh_2
buffergn0me: I have .html files that are handwritten instead of using a markup generator
21:19:13
Josh_2
I'll write my js with parenscript and output it to files then just manually include the names in my html files