freenode/#lisp - IRC Chatlog
Search
12:06:35
syntaxfree
I did "dr. scheme" in college for a course that was a light dumbed down sicp-alike. sure, fun stuff.
12:07:05
syntaxfree
but I came across Hy. and I'm replacing bits of this larger ML-oriented API products.
12:14:03
no-defun-allowed
Hy doesn't have lexical block scoping, so you might have some more surprises from here.
12:15:09
syntaxfree
as far as I can tell Hy follows Python rules of scoping. It would be awkward to learn otherwise.
12:15:53
no-defun-allowed
More awkward to have automatic type coercion and function scoping in a Lisp to me.
12:19:14
syntaxfree
I wish there was more support for type hinting. newer python things are extensively using type hints (eg to validate json inputs and produce valid Python objects from JS objects)
12:20:32
syntaxfree
almost all of my "higher level", organizational Python code is type-hinted, with semantic type synonyms, etc. But macros appear to fill in a lot of missing teeth in implementation-level, numpy-based code)
12:21:03
beach
I recommend you program in Common Lisp instead. That way, you have all the type declarations you need.
12:21:42
syntaxfree
beach: it's a good ideal. I'm very fond of Haskell too. But hey, it's a node shop and I'm the weirdo already.
12:22:00
syntaxfree
anyway, this should exist (defmacro np-count [conditional-expression] `(np.sum (np.where ~conditional-expression)))
12:27:13
no-defun-allowed
Yeah, I would rather work in a proper Lisp that has a compiler that can actally take advantage of type declarations.
12:29:40
syntaxfree
theré's also the fact that python is not very good at inlining code. if it does it at all. a lot of syntactic effects can be achieved in "pure functions" style, but that's less good with large non-sparse matrices.
12:31:46
syntaxfree
I basically learned the basics of programming with Haskell. So I see pure functions everywhere. The enlightenment is that a lot of what I do with "pure functions" is literally syntactic sugar. Should be unrolled at the get-go.
12:33:30
syntaxfree
also often many functions-to-make-syntactic-sugar are a single macro. Because reasoning about syntax and reasoning about semantics can be separated. This is brilliant.
12:35:37
LdBeth
I guess you get confused by what’s should be called user definable control flow and what’s real syntactic sugar
12:37:41
syntaxfree
because there's a lot of functional programming that's actually reasoning semantically with functions. It can't all be unrolled at "compile time" (this is ill-defined for python but anyway)
12:37:52
no-defun-allowed
I should mention that if you use CPython, there's basically no compilation that would make use of any optimisation techniques, it's just a plain bytecode interpreter. But that's the end of that.
12:39:24
syntaxfree
but there's a lot of higher-order functions that are really about "ergonomic improvements".
12:39:28
jackdaniel
maybe more direct approach will be better: please move the offtopic to #lispcafe ;p
12:39:54
LdBeth
syntaxfree: it’s usually a bad idea mimicking features of functional programming in a language not designed with at least some functional things in mind
12:41:02
syntaxfree
LdBeth: that was half a comment. I was saying there's genuine use cases for functional programming and cases where higher-order functions are used for programmer convenience. I'm moving to #lispcafe as directed by community leaders.
14:33:29
sarna
hi, what's the standard book I should grab for learning lisp? for scheme there's SICP and the little schemer, don't know about lisp equivalents
14:34:15
jmercouris
Gentle introduction to symbolic computation is a good one, as is Practical Common Lisp
14:39:54
jmercouris
I like Gentle introduction because it goes through from the very basics, even though I had a degree and around 10 years of programming experience, I still enjoyed learning about everything from a blank-slate perspective
14:41:40
sarna
I've dabbled in many languages and have been programming for a couple of years, I haven't written any big projects yet though
14:42:20
Xach
few books show you how to make complete, real-world projects, and those that try seem to go out-of-date quickly. but you will get good fundamentals.
14:43:05
sarna
I don't like books that go and make some big project the center of attention - I feel like not learning much
14:43:28
beach
sarna: In case you get stuck, there is #clschool for basic questions. Some newbie questions are tolerated here, though.
14:43:29
sarna
there's a C book and the author is using his own parser library, and you write a scheme using it.. I didn't like it at all
15:11:14
Xach
Today's useful, single-purpose project for me is cl-cpus which provides (cpus:get-number-of-processors)
15:14:09
jmercouris
you would need to know a lot of hardware specific details about those CPUs to actually do anything useful with that knowledge
15:14:49
jmercouris
I guess if you made a utility for someone that they can run to check out how many CPUs they have in their machine, that could be useful
15:18:31
Xach
jmercouris: if you were creating a kernel for lparallel, what would you use to give a good worker count?
15:19:05
mfiano
It would be useful to me as well, if it was portable to any implementations that mattered. I'd probably use it to allocated a thread pool
15:20:13
jmercouris
I would probably run some test to see on however many threads my application is most efficient
15:20:36
jmercouris
and then allocate or deallocate the necessary amount of threads, I would never directly introspect the hardware to answer questions about how my software will run
15:20:54
Xach
mfiano: I like it. I am running into trouble converting some code that was very single-threaded into lparallel because it relies on things like process cwd which is not thread-local.
15:21:39
Xach
And I think I might be running into sb-ext:run-program issues with threads too but I'm not completely sure.
15:21:59
jmercouris
also depending on the cache, fsb of the processor, well, more threads doesn't necessarily mean better performance, even for a workload that can be parallelized
15:23:13
scymtym
Xach: are the issues performance-related? there have been recent changes affecting the performance of spawning sub-processes in SBCL
15:23:59
Xach
scymtym: no, I'm getting errors about binding SB-<something>:FILENAME to a non-pathname and too many open files
15:24:08
pfdietz
I worry about overheating the CPU on my machine if I'm running on all the (hyperthreaded) cores. So maybe a cl-temperature package would be useful.
15:24:23
Xach
I don't have the exact messages handy, sorry, but I can get them sometime later today.
15:27:06
Xach
I also struggle with errors in workers and their interaction with slime - it means reverting more to a batchlike mode of debugging
15:31:14
Xach
Right now I build each quicklisp project one-by-one and see what succeeds or fails. This is done with a shared fasl cache so it is not completely clean, but with a clean cache on each run it would take forever. It already takes two hours. I am looking to build more projects at once, but there's an issue of clobbering each others' fasls.
15:31:43
Xach
So I was thinking about binning projects into 16 buckets with 16 fasl caches and using lparallel to build N at a time without fasl clashes.
15:32:34
Xach
This required working out a bunch of bad assumptions but I am not sure I worked them all out.
16:02:51
ck_
So it has come to this. The old nemesis, topological ordering, has returned for a final [and so on...]
16:43:55
_death
Xach: this sounds like the quickdoc talk on the last ELS.. though I remember feeling there had to be a better alternative than the solution presented
17:10:12
gibsonf1
Is anyone interested on collaborating to build a CL implementation of Numenta's Nupic Hierarchical Temporal Memory Machine Intelligence system? https://discourse.numenta.org/t/common-lisp-htm-implementation/6279
17:16:19
gibsonf1
I'm thinking of first capturing the structure of the system in a graph, cl-graph, and using that as the main way to work the data
17:19:43
shka_
gibsonf1: anyway, whole deal with HTMs is that you are building sort of bunch of perceptrons predicting each other activation
17:20:26
gibsonf1
I'm keen on the hierarchy part, taking the first set of results and processing those etc for higher abstraction
17:21:56
gibsonf1
I think they just haven't quite figured out how to get there yet, although the neuroscience supports it. That's why I'm taking a spatially correct graph approach work with
17:34:06
Xach
scymtym: "The value NIL is not of type <pathname stuff> when binding SB-KERNEL:FILENAME"
18:00:31
Xach
scymtym: Not sure. This is from within a lparallel worker and I don't have the backtrace.
18:01:28
Xach
Also getting "#<SB-IMPL::HANDLER INPUT on BOGUS descriptor N ... has a bad file descriptor."
18:57:56
Kurvivor
i have built it in cygwin, and to my horror it crashes due to stack overflow any time i try to compile lisp files
19:20:10
jackdaniel
Kurvivor: I'm going to sleep soon, so I won't be able to help immedietely, but please report the issue on ecl's issue tracker