freenode/#lisp - IRC Chatlog
Search
23:05:26
_death
cgay: CL is a dynamic, interactive language.. it's better to have a Lisp function that can read a schema and make it ready for use than to use a C++ tool to generate Lisp code every time
23:06:36
cgay
A .proto file is the canonical definition of a protocol buffer. If you want to interface with other languages, you want your code to be compatible with the canonical definition.
23:06:58
_death
cgay: I believe the protoc approach came about because in C++ (and other statically typed language) such code generation is more tolerable
23:08:37
jmercouris
much in the same way that if I write a new python interpreter and add some features and/or different behavior than the standard one, I can expect my python will not work with other people's code so nicely
23:09:33
jmercouris
you know what really really sucks? cryptic code with many layers of indirection to the point where it is fully undebuggable
23:09:53
cgay
_death: let's assume there were no .proto file to syncronize between languages. What do you envision is keeping them in sync? good will? :) It's the Interface Definition Language, to harken back to CORBA.
23:10:55
_death
cgay: I am not talking about proto:define-schema, which is nice to have, but something that can load a .proto file at run-time.. in C++ etc. they may assume it would have to be interpreted at runtime or something, but in Lisp you can just generate efficient code (say via COMPILE or EVAL)
23:11:50
_death
cgay: so then you have a load-proto-file and it's the lispy, dynamic, interactive way.. similar to LOAD
23:11:56
cgay
just don't use define-schema directly. (unless you want to live in an only-lisp world.)
23:12:59
jmercouris
here's the tough part, SHOULD THE STANDARD CHANGE, your Lisp code that generates the functions will have to change too
23:13:07
jmercouris
and so that is a moving maintenance target that I would rather not be responsible for
23:13:51
_death
cgay: protoc is just a tool.. Google has a spec for the protobuf write format and interface description language
23:14:43
_death
jmercouris: a spec is much better.. it is complete, because tons of google data is encoded using protobuf format
23:15:25
_death
and there are many tools to work with that, and they have a huge interest in maintaining backwards compatibility (that's a main reason for protobufs, after all)
23:16:49
cgay
Protocol buffer... because it's a buffer for a gRPC message and is re-used over and over (usually).
23:18:18
_death
indeed it's a google product, but one they've become very dependent on, so there are parts of it they cannot change
23:21:27
_death
jmercouris: there are other formats, but there aren't many high quality lisp libraries for them
23:26:23
_death
there are also many projects that use protobufs already, e.g. openstreetmaps.. so it makes it easier to play with them
23:27:21
cgay
what are the competing technologies (I mean if we're going to ignore protobuf because of politics)?
0:22:45
_death
anyway, with a small patch it seems to work: https://plaster.tymoon.eu/view/1680#1680
0:39:21
ebrasca
I don't know why I am geting 'System "next/ring" not found' . I updated someting and asdf can't load next.
4:57:40
verisimilitude
I keep seeing this stupid advice to avoid :USE, so I figured I'd start an argument about it here. Also, this local nicknames nonsense isn't standard and shouldn't be encouraged.
4:59:20
no-defun-allowed
Sure. Here's my two cents: eazy-opencl is decent, except that it accidentally overwrites a macro in CFFI which I presume it did not have before.
4:59:43
beach
verisimilitude: You need to tell #lisp participants that you come here mainly when you are bored and want to argue.
5:01:50
no-defun-allowed
When eazy-opencl was written, it assumed some properties of the set of symbols CFFI exports, notably that WITH-FOREIGN-ARRAY was not exported by CFFI; but it is now.
5:03:19
no-defun-allowed
Now eazy-opencl overwrites that macro, and code loaded after eazy-opencl that uses that macro could break in awkward ways.
5:04:12
no-defun-allowed
It is a somewhat high-level abstraction over a OpenCL interface, which I use for my GPU-accelerated Petalisp backend.
5:04:58
verisimilitude
Is there any reason it needs the CFFI or would it be possible to interface with it in Common Lisp?
5:05:54
no-defun-allowed
And its use of CFFI isn't the problem here; the problem is that it :USEd CFFI and overwrote one of its macros.
5:06:47
verisimilitude
Both can be issues; anyway, this could be solved by changing either or using a CFFI before the change.
5:09:33
no-defun-allowed
phoe often mentions a similar situation with Alexandria, where packages that use that could also break other packages subtly. That has a greater probability of being a problem, because more packages use Alexandria than eazy-opencl (which isn't even in Quicklisp), and it's often treated like a necessity like the CL package to use.
5:10:48
verisimilitude
I've had the misfortune of reading through code which uses Alexandria, yes. There's no little good reason, I think, to not simply add to Alexandria if it's desired. Fretting over hypothetical ``breakage'' is silly.
5:11:00
no-defun-allowed
(defpackage netfarm (:use :cl :ironclad :s-base64 :flexi-streams :split-sequence) ...) ;; There's something else I have to clean up, then.
5:12:25
no-defun-allowed
It's not really hypothetical; I just described a case where we got some breakage, and I am saying that for that one case with two seldom used packages, there are dozens of cases with Alexandria and everything that depends on it.
5:12:46
verisimilitude
Thinking about ALEXANDRIA, I'm reminded of some discussion here where it was acknowledged a very inefficient implementation was in-place, where unnecessary.
5:13:19
verisimilitude
It's fine to design a library which isn't intended to be USEd, but to advocate against it entirely is silly.
5:14:24
verisimilitude
An easy solution is to not use a newer version of a library unless you've audited it. This does make the accumulation of dozens of dependencies harder, though.
5:14:57
no-defun-allowed
Sure, I'll name a case where it is useful: in decentralise2, I have a package decentralise-utilities that has parsers and generators for some of my internal formats, and some other macros.
6:27:07
asarch
I read that old-school Common Lisp programmers used to do string operations using symbols
6:41:56
White_Flame
olde timey lisps would break apart symbols into lists of single-character symbols for processing, then intern them back into a single symbol
6:51:27
asarch
For example, the user will input random numbers until he inputs 'q' to exit and do the average of those numbers: http://paste.scsys.co.uk/587907
6:56:19
asarch
I now, even (string=) won't work when you type "1": The value 1 is not of type (OR (VECTOR CHARACTER) (VECTOR NIL) BASE-STRING SYMBOL CHARACTER)
6:56:38
beach
asarch: Also, why do you not call READ in the LET binding, rather than having a default LET binding and then assigning to it?
6:56:39
beach
asarch: And when you expose code, you should make sure it is indented correctly. Common Lisp programmers rely on indentation to see the structure of the code. If you have the wrong indentation, you force people to count parentheses which is not polite.
6:58:34
no-defun-allowed
Copying from the REPL is going to indent it funny, because the first line is "indented" less in the copied text.
6:59:41
beach
asarch: Clearly, you should not use READ if you want to enter things as strings. READ will produce Common Lisp objects, like numbers, symbols, arrays, etc.
7:16:33
beach
asarch: It is considered bad style to use an IF with only one branch. The more specific WHEN and UNLESS should be used then. There is a very general rule in programming, namely "use the most specific construct that will do the trick", so as to inform the person reading your code of your intentions.
7:16:33
beach
asarch: WHEN and UNLESS are more specific than IF, because they say that you are only evaluating the body when some condition holds, AND you are only evaluating it for its side effect rather than for its value.
7:21:49
asarch
Actually I did it. I like to know your opinion about my code because that's the way I learn the "good manners" in Common Lisp
7:25:45
phoe
also I don't think CL can be learned in full in 21 days, it takes a somewhat longer time to do that
7:28:07
asarch
For example, the part about condition gives me 1000 questions instead of show me the conditions in a very precise way
7:28:19
no-defun-allowed
Generally speaking, when you read a book, it is assumed you start at the start, and go through linearly unless you are already familiar with the topics covered.
7:28:19
no-defun-allowed
That is to say, that you are expected to know most of the content covered in the chapters preceding the chapters on classes and generic functions.
7:28:25
verisimilitude
I also find this insistence that using an IF with only one branch is bad style silly.
7:30:58
asarch
Exactly. And the first thing you should learn is: Common Lisp IS NOT C/C++, why? Because most of programmers (if not all of them) come from C/C++
7:31:25
asarch
So, for example, when they want learn Python, they usually compare this from Python with that from C/C++
7:32:19
no-defun-allowed
Or in other other words, you should ensure you understand the concepts presented in the book, before proceeding to read later chapters that will likely refer to those concepts, leaving you confused.
7:32:55
verisimilitude
I learned Common Lisp by reading CLtL2 and then a list of differences with the final standard.
7:33:45
no-defun-allowed
"Lisp can be learnt in a day [citation needed], but if you know C, then it's three days."
7:37:13
no-defun-allowed
verisimilitude: Somehow I think this may lead to a good application of <https://xkcd.com/2270/>.
7:39:42
no-defun-allowed
One can formulate a good style guide and/or learning strategy by ensuring they don't do what you do.
7:40:53
verisimilitude
It's amusing, because looking at the advice shared here gave me some inspiration for that most insidious stupidity to remark against in my style document.
7:41:47
verisimilitude
Have fun being scared of &AUX, USE-PACKAGE, and pretending your CFFI wrapper is a Common Lisp program.
7:42:04
no-defun-allowed
asarch: That's exactly what A Gentle Introduction to Symbolic Computation is.
7:42:57
no-defun-allowed
If you would like to recreate the OpenCL framework and the drivers for my graphics card in Common Lisp, you're more than welcome to.
7:43:30
no-defun-allowed
(And I think the Linux AMD drivers are open source, so you shouldn't have too much trouble with that :)
7:44:07
verisimilitude
I wouldn't mind being paid for such, but I figure you wouldn't actually want to pay for it, and would simultaneously complain when it's AGPLv3.
7:45:21
beach
I can understand why someone would prefer to ignore conventions, but I can't for my life figure out why someone would want to encourage others not to follow conventions.
7:47:33
verisimilitude
Just because this channel is named ``#lisp'' and is on Freenode doesn't make it authoritative, beach, even though some would prefer to think otherwise.
7:47:54
verisimilitude
There's a similar issue with ``the front page of the Internet'' in thinking itself so important.
7:48:39
verisimilitude
None of you would know, but I was the only one who bothered giving any feedback regarding that recent Common Lisp survey; the Reddit users were content to share stupid jokes and vapid praise.
7:48:52
verisimilitude
Ironically, I can't participate in the survey, however, because it requires Google JavaScript.
7:49:15
no-defun-allowed
(The only reason I don't use it, is because my only large project for the last year has been a distributed object system, and I need to be sure that blame doesn't go where blame shouldn't go, namely that node operators don't get in trouble if their nodes download inappropriate content without knowing any better. Oh, and I was doing weirdo licenses before it was cool, even before the CNPL...)
7:49:23
verisimilitude
I told the fellow managing it that he should expect a fairly incestuous turnout, considering he only shared it here and Reddit.
7:54:09
verisimilitude
I was going to share it with my group, but I can't advocate for it, due to these reasons.
7:55:28
verisimilitude
I don't enable JavaScript at all, jdz; considering it's a basic form, there's no reason it should be needed.
7:55:55
verisimilitude
Requiring me to enable a megacorporation's JavaScript just to participate in a survey isn't much for community, in my eyes.
7:56:25
verisimilitude
I really didn't like that it was Google at all, but not even the radio buttons work without JavaScript; it's just a giant mass of <script>.
7:56:49
jdz
I agree with you that you may live your life keeping to your values, but you should not complain about other people having different opinion about them.
7:57:15
verisimilitude
I merely mean this consequently prevents the Common Lispers such as myself from participating, leading to what I deem the ``incestuous'' turnout.
7:57:37
verisimilitude
The medium is the message; the setting of the survey determines who will respond.
7:58:28
verisimilitude
I'm the only one who bothered to send the fellow an email about it, and contributed the idea for several questions he'd not thought of.
10:22:19
aeth
My first reaction was "oh verisimilitude is back, isn't verisimilitude the one with the odd style?" and then I read the text and it's a style debate. Some things never change. :-)
10:23:19
aeth
I guess you can assume most Lispers are unlearning C and/or C++. For a while there there was a very good chance that people might've learned Java instead of C++, but thanks to Oracle's neglect after the Sun acquisition, C++ kind of made a comeback in teaching afaik.
10:25:52
aeth
JavaScript might actually be a "security feature" as in a "don't cheat the survey" feature. Obviously this assumes that it's the worst case, privacy-destroying JS, too, which is probably is. On the other hand, thanks to the recent Nevada Caucuses (last Saturday), we can now say that Google Forms were used for an election so...
10:30:01
aeth
As for USE, IMO you can (probably) safely use exactly one thing other than CL, assuming that it's very unlikely that a conflict will be introduced later on, especially if e.g. it's another one of your own libraries.
10:31:24
no-defun-allowed
To be fair, I was able to repeatedly send a HTTP request to resend my response many times a couple of years ago with Google Forms.
10:32:53
aeth
But I I'm guessing the USE stuff is in response to https://old.reddit.com/r/lisp/comments/f98d1h/modern_functional_common_lisp_myths_and_best/fipyf7u/