freenode/lisp - IRC Chatlog
Search
4:04:57
beach
aeth: First-class global environments are not just a small extra feature the way package-local nicknames are. They require a large part of the existing system to be restructured and a lot of the code to be rewritten.
4:06:55
beach
phoe: So I don't think first-class global environments would be represented by a single pull request. If I were to implement first-class global environments in some existing implementation, I would make gradual changes over a long period of time.
4:13:23
beach
Plus, with first-class global environments, there is a (small) performance cost for things like SYMBOL-FUNCTION with a symbol that is not known at compile time. Maintainers of implementations that want maximum performance in all situations would not be willing to accept that.
4:18:45
Oladon
Anyone here used spinneret for HTML templating? I'm trying to figure out the best way to implement nestable templates, and his deftag doesn't seem quite right.
5:52:04
drmeister
Xach: I'm glad - you've probably read this... https://www.nytimes.com/2020/03/22/health/coronavirus-symptoms-smell-taste.html
7:33:31
beach
phoe: Though there is one more advantage. When the code of a Common Lisp implementation is restructured in order to allow for multiple global environments, the code becomes more regular and more independent of the specific details of the implementation.
7:59:08
beach
ear-the-art: It was aeth who asked whether I thought that first-class global environments would ever become part of existing Common Lisp implementations.
8:01:37
beach
Then, phoe said he might someday be willing to merge a PR for CCL in a forked version.
8:03:30
beach
One reason I started the SICL project is that I think the code of existing implementations is often old and hard to maintain. And I think it would be more work to fix that problem than to write a new implementation from scratch.
8:04:11
beach
A new implementation would also be the opportunity to reconsider fundamental design decisions that may have been the right ones at the time but that no longer are.
8:09:25
beach
But it is going to take time to get a new implementation to be as fast and as stable as the most common existing Common Lisp implementations.
8:31:57
no-defun-allowed
Silly compiler question: do jump tables become less effective as the code they jump into becomes larger?
8:39:20
no-defun-allowed
I'm still trying to guess reasons why binary search would be faster than using SBCL's jump tables in my bytecode interpreter.
8:40:22
beach
I think it is very hard to get answers to such questions. It depends on the code generated by the compiler, on the processor architecture, on the processor implementation, etc.
8:56:45
beach
no-defun-allowed: It may be a case that is similar to the comparison between PCL generic dispatch and SICL generic dispatch. PCL uses a table in memory and SICL uses binary search.
8:57:38
no-defun-allowed
Yes, I based the dispatch off SICL binary search (and we have discussed it before).
9:07:10
no-defun-allowed
You had suggested using a jump table yesterday, and I've been eager to test how SBCL handles those, but I haven't had very good results.
9:09:05
Josh_2
Morning all. Does anyone know how I can optimize these 3 functions https://plaster.tymoon.eu/view/1719#1719 anymore?
9:13:49
no-defun-allowed
And please don't use (safety 0) unless you are very certain that nothing can go wrong, and then only in small doses.
9:17:06
Josh_2
Besides, they are the backbone of the system, they need to be performant for the entire system to be performant
9:24:36
no-defun-allowed
It is usually unwise to use (safety 0) to disable runtime checks, because the problems that could arise if some invariants you decided on are broken would be more of a problem than the slight decrease in throughput caused by checks.
9:24:50
no-defun-allowed
As Baker bluntly put it (in the case of some embedded systems), "rather than having the software discover its own errors in a benign way, the discovery of such errors is left to the FAA or a Congressional committee."
9:26:51
no-defun-allowed
Looking at line 6, (THE BOOLEAN (LISTEN STREAM)) might be incorrect, because LISTEN only returns a generalised boolean. It is also excessive, because comparing an object to NIL is no faster if you know what the object could otherwise be.
9:28:36
no-defun-allowed
I think READ-N-BYTES would be better written as a wrapper over READ-SEQUENCE, but it may be that spelling out the definition gives better type inference in your case.
10:29:19
no-defun-allowed
Some implementations may type check at THE, some may assume the value will always be of the provided type.
10:30:46
no-defun-allowed
But profile your code, please. I would recommend SB-SPROF if you're on SBCL to get some prerequisite information.
10:34:20
heisig
There are also several tools for visualizing SBCL's profiler output, like clim.flamegraph and cl-flamegraph.
10:35:29
no-defun-allowed
Absolutely, then you should move to the non-statistical profiler, which records calls and provides more precise information.
10:36:19
no-defun-allowed
But the statistical profiler just checks a thread's call stack frequently, instead of wrapping functions from a set you choose, which I think is better for getting an idea of where cycles are burnt.
10:44:55
flip214
> SBCL includes both a deterministic profiler, that can collect statistics on individual functions, and a more “modern” statistical profiler.
13:51:21
jdz
Bike: Just look at the list of people in this channel, and how many of them you know have typed anything?
13:59:26
flip214
Bike: if there are no members, just assert yourself as the first one -- and declare independence!
14:00:51
phoe
flip214: I don't know if the platinum sponsors club can survive an infinite increase in its member ratio
15:42:19
_Ark_
Does anyone know a way to get a nanosecond/cpu timestamp in Common Lisp (or at least sbcl)? I'm looking for something like Java's `nanoTime` https://docs.oracle.com/javase/7/docs/api/java/lang/System.html#nanoTime()
15:42:25
_Ark_
I've tried `(get-internal-run-time)` along with `internal-time-units-per-second`, but on SBCL it gives milliseconds.
15:44:47
Xach
_Ark_: i don't know if there's a more direct way, but you could use sb-alien to use the underlying OS apis. if you know what OS api provides it, you could also grep SBCL sources for something that uses that API.
15:46:24
pjb
or (com.informatimago.common-lisp.cesarum.time:get-real-time) #| --> 3.794139978273096D+9 |#
15:46:39
pjb
or (com.informatimago.common-lisp.cesarum.time:get-run-time) #| --> 7.1337779999999995D0 |#
15:48:56
_Ark_
Xach: I want to add some built-in profiling to my game engine. Mircoseconds will work for this, but I was curious how fine-grain of time lisp can get.
15:51:00
_Ark_
Yeah I figured FFI was always an option. Was wondering if there was a "standard" way to do this. For some applications nano-time is desierable
15:51:39
Shinmera
That resolution won't be useful because it'll be highly dominated by noise anyway.
15:53:58
_Ark_
I used to be an APM (Application Performance Monitoring) devleoper for the JVM. Basically a simple profiler designed to run in production. We always measured in cpu nanoseconds. In practice it ended up being useful.
15:56:08
_Ark_
Looking though some of the libraries people linked. Seems like `local-time` on sbcl is using `sb-ext:get-time-of-day` under the hood. I'll take a look at monotonic-clock next...