freenode/lisp - IRC Chatlog
Search
9:36:31
decent-username
hey I'm trying to run slime and I get the following error: https://paste.gnome.org/pt8dbzbnx
11:11:46
schweers
I find setting them is a mess. I don’t think I should have to use an ancient shell to set these variables.
11:12:03
schweers
Although I do see why they are used. Kind of like special variables for processes.
11:12:25
pjb
The only thing to understand, is that environment variables are set by a process, and inherited (transmited to) its children.
11:13:12
pjb
For example, on macOS, applications are not forked from a shell, even if you launch them from the Terminal (with open), but by a launcher process.
11:14:47
schweers
pjb: what if one launches a long lived command line tool? For instance calling rsync on a large dataset and/or a slow connection?
11:15:27
pjb
So you can see that you can, even on a "unix" system, configure environment variables WITHOUT having to use an old shell.
11:16:26
pjb
schweers: again, it's irrelevant what you launch or how you launch it. What matter, is WHO launches it, because it's the parent process that transmits the environment variables IT has set, to its children.
11:16:43
schweers
Ah, so there is an extra process in between, which sets all the environment variables for the child process?
11:17:33
pjb
But you can also fork the application executable directly from a shell just like any unix program.
11:19:10
pjb
Now, yes, kind of special variables for processes. Also, usually programs don't clear out the environment. At most, they may add or change a couple of variables. So grand-children will get the environment as set by their grand-parent. Which can be useful.
11:19:50
pjb
On the other hand, this may also be a security concern. Hence the env -i command, and programs cleaning their environment upon entry. It may be harder to use those programs…
11:20:25
pjb
Notably, there are (or were) some nice bugs in bash regarding the handling of some environment variable.
11:20:54
schweers
Maybe a more standard way of setting initial variables would be sufficient to address my complaints.
11:21:40
schweers
And setting them for already existing processes. If I decide I want to change a variable, already existing processes won’t be affected by this change.
11:22:05
pjb
What more do you want? https://pubs.opengroup.org/onlinepubs/9699919799/utilities/env.html
11:23:32
schweers
Maybe my real problem is with this whole zoo of files which get processes by various shells in various circumstances. Which may or may not set environment variables. I think my complaint was poorly thought out and I hereby retract it until I have thought about it some more.
11:27:26
pjb
schweers: usual shell let you specific an environment file. So you would do BASHENV=$HOME/yourenv.sh in .bashrc for example, and something equivalent in the rc of the other shells, using the same $HOME/yourenv.sh so you can edit a single file.
11:28:39
schweers
but as I said, I guess I need to think more about what my actual problem is before I voice my compaints.
11:28:53
pjb
Otherwise, you can always write the code to parse the xml environment.plist file to define the environment variables!
11:31:59
schweers
shka__: no, but the result is still that we have multiple languages claiming to be a lisp.
11:34:06
no-defun-allowed
schweers: don't you know clojure is the modern incarnation of lisp and the only one will scale to potatoes, (jvm-running) quantum computers, space probes, CAD software, etc, etc
11:35:18
schweers
I know that clojure is a modern incarnation of ... something lisp like? I think it has some nice ideas which are unrelated to lisp itself. I’m not sure I’d want to use it for real work though.
11:36:35
no-defun-allowed
a lot of the clojure "magic" sounds only that useful for embarrasingly parallel stuff, in which case you can just lparallel:pmapcar and get better speed
11:38:25
schweers
It mostly smells of jvm, but I guess you can never truly hide the abomination that java the “language” is.
11:40:18
no-defun-allowed
maybe the less braindead but still awkward ABCL users write in camelCase even
11:40:55
schweers
abcl does seem to be a nice tool if one has to interact with a jvm for some reason.
11:40:56
no-defun-allowed
and (cons 1 2) also doesn't work but anyways, discussing actual lisps on #lisp hurts my head less
11:44:47
no-defun-allowed
i thought the moral of "CONS Considered Slightly Harmful" was to make binary trees of some form for efficient parallel processing, not pretend you have conses which actually aren't conses but i don't have any work experience like rich hickney and i've been spoonfed useless propaganda by BDFL-less programming language theory researchers
11:47:32
no-defun-allowed
basically this image sums up my feelings towards clojure and i shall speak no more of it tonight: https://i.redd.it/ffne9jvbeer21.jpg
11:48:16
no-defun-allowed
(psst, phoe: in Clojure family languages arithmetic is basically allowed to do whatever the host platform finds least annoying, like having everything as floats in ClojureScript)
11:55:19
jackdaniel
also I would expect that having too big bignum would exceed the heap and signal a condition, so it could be interpreted as an overflow
11:56:52
no-defun-allowed
hopefully that overflow is a bit bigger than a fixnum, else your bignum is not very big
11:57:04
no-defun-allowed
https://www.jwz.org/blog/2008/03/most-positive-bignum/ may be relevant in a way?
11:57:58
phoe
as for heap exhaustion, it'll be either a storage-condition or a game over screen I guess
11:58:59
specbot
Conformance Statement: http://www.lispworks.com/reference/HyperSpec/Body/01_eae.htm
12:00:22
jackdaniel
i.e on machines we have today it is impossible to represent arbitrary numbers (be it floats or bignums), so it is a platform limitation
12:03:40
xristos
jackdaniel: CL not forcing me to expend mental energy to worry about how to handle integer promotion/overflow is pretty close to a silver bullet
12:04:42
no-defun-allowed
The universe and our computing time are both finite, but bignums (and ratios) are less annoyingly finite.
12:06:57
jackdaniel
instead of debating how pitiful are clojure programmers we should catch up to them in at least a few fields we lack (as CL community and ecosystem) -- it is really a difference between reassuring yourself you are the best and trying to improve yourself
12:11:00
dmiles
CDR7 (format "~0,f" 1.0001) is supposed to be (floanum-to-string 1.0001 NIL 1 NIL) ?
12:15:46
jackdaniel
afair if float doesn't fit in width, then you need to use *minimal* number of characters
12:16:52
jackdaniel
so it would be 1., but if you had 0.001, you'd have a result .0 (which is a correct float)
12:17:13
jackdaniel
fun stuff, I remember pulling out my hair reading through the spec to get it right ;)
12:19:05
jackdaniel
as you can see, I don't remember it by heart, so I'd refer to the spec for details
12:22:13
dmiles
but now i am wondering how you can say "use whatever precision but let me contorl the left side"
12:23:56
dmiles
like ... (format nil "~10,0f" 1234.056) => " 1234." (format t "~1,1f" 1234.056) => " 1234.1" .. next come "control"
12:25:02
jackdaniel
you want to cut integers at the beginning? that would be incorrect result, not a lost precision
12:26:51
dmiles
i was incorectly reading the spec thinking that was what (format t "~10,f" 1234.056) did
12:27:35
White_Flame
I think you mean print so that the decimal point always lines up, no matter how many fractional digits there are printed
12:30:47
White_Flame
but still, "I want to get this string" doesn't fully describe what features of that string make it the correct represtation for you
12:32:16
White_Flame
I don't think the comma changes anything, since no parameter is given for its slot
12:33:38
jackdaniel
what White_Flame says. first number says how many characters (if doesn't fit, implementation must use minimum number of characters)
12:35:25
White_Flame
"~<totalchars>,<fracdigits>f" If either are not specified, then it simply prints however many characters are appropriate
12:36:29
jackdaniel
the most recent release is 16.1.3, maybe try that (I don't remember when I was working on format float exactly)
12:36:59
dmiles
ok.. good.. btw .. now everything makes sense.. I did understand the doc .. i just might have an outdated ECL
12:41:20
dmiles
how i was making the mistake is wasnt really taking in acount for <totalchars> correctly
12:47:59
dmiles
my original question was supposed to be about https://gitlab.com/embeddable-common-lisp/ecl/blob/master/src/lsp/format.lsp#L113
12:51:34
jackdaniel
if you pass width 10 and do not specify fdigits, then width is 10 and fdigits is still nil
16:07:25
another-user
why this is so slow? http://dpaste.com/0NSR3JR it takes eternity to process 4MB file