Threads for jakob

  1. 5

    Energy / electricity usage…?

    1. 10

      I thought it was refreshing to find an article that doesn’t mention that.

      The excessive energy consumption is the larger societal harm, as I see it, but I also appreciate that we’re able to point out the legitimate technical flaws that reveal how the designers were thinking only in the short-term.

      1. 12

        To the best of my understanding, not enough people know about this wasteful aspects. Mainstream news often don’t mention it and instead hype up NFTs. NFT and cryptocurrencies also advertise a lot on shows and podcasts. Never with a mention of this. Sure, a lot of people on here (most) know about it but it seems underreported.

      2. 4

        That’s my number one concern too, but I was strangely glad that it was absent in this write up. It doesn’t mean it’s a non-issue, but it’s often the first thing that crypto people people try to rebut and ends up a discussion tar pit.

        1. 3

          I’ve seen people get out of pow (or out of crypto all together) once they learn about this. There are issues where it’s pointless how much info you try to dump because there’s an underlying values mismatch rather than an info mismatch, but I believe this isn’t one yet, as in, I think there are plenty who would change their minds about it they knew about the energy and electronics waste issues.

        2. 0

          This is mostly an issue for older chains using “Proof of Work” consensus like BTC and ETH

          Basically all new Layer 1 chains these days (Solana, Terra, Cosmos, Avalanche, Polygon, Polkadot, Cardano etc.) use “Proof of Stake” which this is a non-issue for.

          Also ETH is moving to “Proof of Stake” probably Q2 2022. It’s in progress, but difficult to migrate a behemoth like ETH when it’s already in production.

          1. 1

            This is partially the case; probably if BTC were using PoS the energy problem wouldn’t get much attention. But, while it wouldn’t be burning more oil than Ireland for it’s current level of activity, it still just scales really really poorly to have a huge network of nodes all verifying the same ledger. Redundancy buys you resiliency, but it also wastes resources. You don’t want more of it than you actually need.

            When thinking about the future of the technology, it’s easy to wave away PoW, since solutions are known. But large scale ledgers are still doomed to be inefficient, just not so inefficient that it finds its way into mainstream news outlets.

            1. 0

              I mostly agree with you, and BTC is a bit doomed to become “digital gold” because of these inefficiencies.

              But some of the newer PoS chains have a TPS comparable (and in some cases even surpassing) that of Visa and MasterCard, with negligible tx fees.

              Pretty interesting stuff! I’m sure the tech will only continue to improve as it attracts more funding and smart engineers/researchers.

              IMHO the biggest wart on crypto right now is BTC’s use of PoW, but there are some interesting approaches to that issue. See this thread about what the Swedish state-owned (!) energy company Vattenfall has to say on the topic: https://twitter.com/ercwl/status/1457114531314995206

              TL;DR: PoW can be used as a buffer/load-balancer in a mostly fossil-free energy grid like ours.

              1. 4

                PoW can be used as a buffer/load-balancer in a mostly fossil-free energy grid like ours.

                Vattenfall considered harmful when it comes to this. Of course they want to sell electricity. They were very slow at getting out of the coal business, only closing their last plants as late as two years ago. (Growing up in climate activism, Vattenfall was The Enemy for all their coal plants.) I do give them credit for finally getting out of coal, fifteen years after everybody else did, but the talk of PoW being good doesn’t become more true or credible for coming from them.

                The world found out the other day that almost a fifth of the worlds BTC is mined in Kazakhstan on hard coal, the older, ever more inefficient coal plants. Ingen nyhetsgrej direkt because of course BTC is gonna thrive where electricity is underpriced because of externalities not being accounted for.

                As I’ve said before:

                Spending energy on proof of work is not decreasing any fossil burning. It’s just not.

                As an analogy, let’s say I want my students to get safe jobs instead of risking their lives as guillotine testers and tightrope dancers.

                I take a quick glance at the jobs section and see that hmm, safe jobs seem to be paying better over the long run, if not in the short run.

                So I take my students’ paychecks and burn the money in a big old firepit in the yard.

                They’re like “Miss, miss, why’d you burn all that cash!” I’m like “If I waste all your money, I’ll increase your demand for money, and the new money capital expenditure that is most efficient is gonna be safer jobs” they’re not gonna go “thank you miss! That makes sense! We’ll start working those safe desk jobs right away so you can pour more of that money in the firepit!”

                Instead, they’re gonna go “OMG we’re starving and we need cash right now and all our money got burninated, we are gonna go have to go work as dynamite jugglers!”

                They’re not gonna go “Thank you for saving money on paper by flushing the groceries directly into the toilet.”

                Additionally, what’s often elided when discussing the electricity use of PoW is the e-waste. The actual hardware used to mine. That’s a huge climate impact for how quick the obsolescence and turnaround is.

                1. 1

                  And now electricity is so expensive that the gvmt is gonna pop in 6000 000 000 SEK. To the extent that even one öre of that is because of PoW mining, that is severely messed up. Miners have ruthless disregard for externalities and the interconnectedness and interdependence of human activity. New inroads into plundering the Earth 💔.

                2. 1

                  PoW can be used as a buffer/load-balancer in a mostly fossil-free energy grid like ours.

                  I can think of a few other methods for buffering, such as recharging gravity batteries. Waste heat is an undesirable side effect almost everywhere.

              2. 1

                You normally don’t see me complaining about PoS or other FBA variants, like MOB (which Moxie’s app Signal is involved in). I mean, as far as I can see it’s just as proprietary as PayPal and thus pretty pointless, but what I’m mostly complaining about is and has been PoW. You can often see me be pretty explicit about this in other threads. I’m not long in any cryptocurrency including PoS, but you’ll see me complaining about PoW specifically.

                However, I am not going to gice ETH credit for being PoS before it is.

                For example, Reddit is moving to the PoW version of ETH and therefore that’s not OK.

            1. 8

              This year, chronologically:

              • Partner moved in with me to work at a nearby school.
              • Got a return offer from my 2020 internship.
              • Hosted my first capture-the-flag.
              • Graduated university.
              • Tried to have a theory paper published (unsuccessfully).
              • Started working full time, rising to the role of lead engineer for one of the programs I’m assigned to.
              • Took home first in a capture-the-flag for the first time.

              Besides going off to grad school, I don’t have a particularly ambitious plan for 2022. I want to (I) continue to put my best foot forward at work, (II) spend more time with family, and (III) give myself time to read, learn, and work on my personal projects.

              1. 6

                What a fun question.

                Career-related: soft skills; team leadership; all the “cloud” stuff I’ve put off out of distaste for the constant bombardment of hype; the Linux networking stack.

                Personal: Haskell; GTK; OpenSCAD; compiler design. I’m also planning to go through the TAOCP box-set I got for my birthday.

                1. 2

                  OpenSCAD

                  Warning: hacks abound. OpenSCAD suffers from a fundamental issue where:

                  1. You need to constantly create shapes by subtracting one shape from another shape
                  2. Said shapes need to be precisely defined
                  3. OpenSCAD doesn’t handle subtracting a shape with a precisely-overlapping surface due to rounding-error issues on the same real-number calculated differently.

                  The end result is that you need to slap on epsilons everywhere, i.e. you create a constant ‘epsilon=0.01’, then instead of carving a cube(5,5,10) from a cube([10,10,10]) you have to carve a translate([0,0,-epsilon]) {cube([5,5,10+(2*epsilon)]);} from a cube([10,10,10]).

                  This means you have off-by-epsilon errors everywhere, for basically every complex shape you make. First you create the shape, then you spend several minutes adding all the

                  What’s worse is, sometimes you do get the epsilons right, but you still get weird z-fighting artifacts in the preview with no elegant method of removing them. Not to imply the epsilons are an elegant solution in the first place.

                  1. 1

                    That sounds.. painful. Thank you for the insight. Perhaps I should have my goal be to learn CAD in general rather than OpenSCAD.

                1. 11

                  I’m interested to see the responses to this one. Deliberately practicing programming isn’t part of my routine now. It might have value if I were still a “new programmer,” but in my case, years of recreational programming have sated any perceivable need for practice.

                  It takes a lot of effort to come up with a routine that’s more effective than the “sink or swim” approach – effort that could be more meaningfully spent working toward whatever you’re learning programming to do.

                  1. 7

                    I am soon to be making the decision of where to apply for grad school. U of M is no longer on my shortlist.

                    1. 2

                      I’m interested in hearing why this board is especially well-suited for running languages like lisp. I spy a STM32f (ARM) core. Does this board do something that the RPi doesn’t?

                      1. 1

                        That’s like asking what’s so special about Arduino. It’s all software.

                      1. 3

                        If you’ve never written a Lisp before, I can recommend Janet as a nice introduction to that world.

                        1. 1

                          May I ask why do you like it, and how it compares to more traditional choices like Scheme and Common Lisp?

                          1. 2

                            Regarding the second point, they’re similar. The syntax is the same, and you have “similar enough” primitives for working with sequences. There are a few “big” differences, like most sequential data structures not being linked lists, but it still feels lisp-y to me.

                            Racket is another beginner-friendly Lisp if you’re looking for something resembling Scheme. It has a nicely-written guide. The Janet documentation might be a bit confusing if you don’t have prior experience with lisp.

                            1. 2

                              I have a few reasons that I like it.

                              I tried it on a whim for Advent of Code 2020, and ended up liking the PEGs quite a lot.

                              Then, as I’ve used it more and more, I’ve grown to like it for it’s macros, and for the rather practical sensibilities it has around it’s data structures. It is still very young in an ecosystem sense, so it’s a great chance to learn how to build things for a small ecosystem, and/or to practice hacking on C extensions, or writing things in Zig (there are some people working with zig with it).

                              I don’t have deep experience with Scheme and Common Lisp.

                          1. 16

                            I am a big fan of Janet, which I find pretty cool to use and manipulate.

                            Two features come out as strikingly useful to me, on top of the language being compiled.

                            • The very simple to use and very efficient PEG in the standard library
                            • The DEAD EASY C interop, which makes using C features or libraries a dream.

                            I use this language at work to parse logs, automate some tasks, and I also use it on my personal blog and services for Gemini/text parsing (e.g. to HTML).

                            1. 7

                              Janet is also the “small language” I’ve been using recently, to build a self-hosted tag-oriented CMS for organizing my photos and videos and such. I’m happy with its standard library support for SQLite3 & PEG, the latter of which I have been using to implement the query parser (i.e. turn “give me files tagged with A and B but not C” into SQL).

                              I’ll probably write about it when I’m done with it. I like Janet, but I don’t know if it will become my language of choice. I still very much like good ol’ Scheme (which is probably a bit smaller than Janet).

                              1. 1

                                Honestly, that depends on how much of the Scheme standard is implemented by the Scheme. IIRC, the later ones were pretty large, no?

                                1. 2

                                  R6RS is “large” relative to R5RS/R7RS. I wouldn’t call it “large” relative to other programming languages. R6RS is probable comparable to the Janet stdlib.

                              2. 2

                                on top of the language being compiled

                                I’m curious as to what you mean by this. Isn’t this true of nearly every language?

                                1. 5

                                  Janet makes a building an executable out of your scripts a first class experience, as opposed to the second or third class experience it is in Ruby or Python. (I don’t know where fennel sites here, beyond Love2Ds bundling tricks).

                                  If I had to guess, that’s what is being referred to here.

                                  1. 2

                                    I see; so specifically the fact that the compilation output is bundled up into a single binary file then? (Fennel has a --compile-binary command which does this, since you asked.)

                                    1. 2

                                      Sort of. jpm can build an executable if you declare one in your project.janet. of your code and libraries are pure Janet, then you only have to specify the Janet file that acts as the entry point.

                                      But Janet doesn’t have to be compiled that way, it can run as a REPL, and/or as an interpreter. I’m sure you’re probably familiar with that level of flexibility of output.

                              1. 11

                                I agree that naturally recursive data types are probably the best way to teach recursion, but I disagree with the dismissal of the other examples because they “aren’t used in the real world.” This is a really silly argument— a “hello world” program is utterly useless in the real world but still is useful pedagogically.

                                1. 6

                                  The fibonacci and factorial examples also have pedagogical value especially when recrusion is being presented alongside concepts in discrete math. Both give way to simple properties which can be proved easily with mathematical induction, and induction is very useful when it comes to actually proving that recursive algorithms are correct.

                                  1. 4

                                    a “hello world” program is utterly useless in the real world but still is useful pedagogically.

                                    um I’m not sure that I agree, I print strings to stdout pretty often, but I’ve never ever needed to compute a fibonacci number for anything

                                    1. 2

                                      You print strings to stdout, but do you print the string “hello world” to stdout? Or was the hello world program a nice way to teach you printing that was unrelated to real-world applications? One of the other classic pedagogical programs students have to write is a choose-your-own-adventure (teaching branching), yet I am not a VN developer. Was this a bad program to have me write?

                                      1. 3

                                        I view the hello world program as a way to get students (or programmers) familiar with the tools of the trade (or a new platform).

                                      2. 1

                                        I print strings to stdout pretty often

                                        Yes, just as people use recursion pretty often; you’re missing the point.

                                        You should be consistent in how generally you look at each example program.

                                        Nobody applies printing in the real world to print only static values in the whole program, just as nobody applies recursion in the real world to fibonacci, but you’re looking at the generalities of hello world and the particulars of recursive fibonacci.

                                        Both apply techniques that are used in the “real world”, even if the way they’re applied isn’t done in the real world. You can’t say, “but I do print values”, but then attack the fibonacci program when people do use recursion, which is what it’s demonstrating, not fibonacci itself, just as the hello world program isn’t demonstrating how to print the specific value, “Hello, world!”.

                                    1. 10
                                      1. PC in the room nearby (I work over USB and HDMI cables) no fan or other noises.
                                      2. a inhouse spring? room fountain? (not sure about the english term) takes care of about 90% of the noises in my ears and distracts zilch comma nada.
                                      3. pi hole blocks some things more during daytime, I would have to go up to the attic to change this (old house, internet still coming over copper wire on posts to the roof, router and pi hole are in the attic).
                                      4. whiteboard, whiteboard markers (the thinner ones), post-its to make a plan for the week, green border around the portion of the day.
                                      5. stop working something completely different (garden, sports, house, hobby, etc) if the portion of the day is done. Dont worry brain keeps running on the task, but can not clog up this way.

                                      for video chat and conferences, I have a different place with an older thinkpad and a logitech cam in front of a sofa with neutral backdrop. I also use it for private lockdown/can-not-travel chatting. my office is sometimes my creative chaos (and will be), and I will never have the problem of someone spotting sensitive data. Plus I do not have the distraction of I might try to call XYZ, maybe he has time..

                                      1. 2

                                        a inhouse spring? room fountain? (not sure about the english term)

                                        Perhaps you mean a white noise machine?

                                        1. 2

                                          I mean a “Zimmerbrunnen”, optically a close relative of this one: https://res.cloudinary.com/chal-tec/image/upload/w_545,q_auto,f_auto/bbg/10034777/Gallery/10034777_yy_0001_titel___Blumfeldt_Riverrun_Gartenbrunnen_Zimmerbrunnen.jpg

                                          I got it from a friend who also has tinnitus, changed the broken pump, gave it a thorough run with the pressure washer and ever since it helps me ignore the noise in my ears, and also to focus my thoughts. It works even if I sit beneath a river or creek.

                                          1. 1

                                            That looks beautiful. Now I’m tempted to find one for my room

                                          2. 2

                                            They may mean one of those little indoor fountains with water trickling over rocks. They’re pretty and make a nice sound. But yeah, of course there are apps and machines to make similar sounds.

                                            1. 2

                                              I’ve found this to be one of the more useful things to do with my Echo Dot. I could put on soothing sounds like running water while snuggling my youngest to sleep. Better yet, I could change the sounds, adjust the volume, etc., all without shifting position to try to reach it and risking disturbing him as he’s drifting off.

                                        1. 4

                                          Apparently the trigger of this radare2 fork is this PR (which got merged in the follow-up PR which actually did it right), but then the person argueing against this change also seems involved in Rizin (“member” badge), so I’m confused.

                                          1. 2

                                            Relevant post from twitter.

                                            1. 1

                                              Thank you for the context. I was not aware of this side of the story.

                                            2. 1

                                              Good catch. I thought I understand it more or less, but I don’t think so at this moment.

                                            1. 18

                                              I certainly would like rust to become even more successful. But I feel like zig is going to take the lead in replacing C eventually, based on my limited knowledge. It’s far easier to integrate with existing C than rust is already. It has even easier ways of having multiple allocators (stack,pool etc) and allows for seamless async-await as far as I know. This makes it even better for usage in embedded environments and the harsh c world of Drivers, Kernels and so on.

                                              Rust is a little bit too heavy or constraining it seems for those bare metal workloads and zig can just place itself as drop in replacement. Sure rust gives you even more guarantees, while zig feels like a tidy C in that aspect. But this may be more desirable than to fit your stuff into rusts totally different world. Or writing loads of unsafe code, while 99% of your Linux Kernel may already be a bunch of unsafe hacks to allow the speed and integration it has.

                                              On the other side are the people that enjoy strong typing but don’t want to interact with the borrow checker, here Nim may be more of an option. Meanwhile Deno/Typescript, Ruby and Python are still staying strong in that field.

                                              And replacing numpy with a rust-ish library sounds nice. But we shouldn’t forget that there are still loads of Fortran libs underneath those heavily utilized python libs.

                                              This may sound pessimistic so I’d really like to get some different opinions on my thoughts.

                                              1. 5

                                                This may sound pessimistic so I’d really like to get some different opinions on my thoughts.

                                                Sure.

                                                Rust is a little bit too heavy or constraining it seems for those bare metal workloads…

                                                There are a few examples of Rust being used in “bare metal” environments. I wouldn’t say it’s constraining to the point that “bare metal” software can’t be written in it. Rust is billed as a “systems programming language”, after all.

                                                Sure rust gives you even more guarantees, while zig feels like a tidy C in that aspect. But this may be more desirable than to fit your stuff into rusts totally different world. Or writing loads of unsafe code, while 99% of your Linux Kernel may already be a bunch of unsafe hacks to allow the speed and integration it has.

                                                I didn’t fully understand this point. That valuing performance over safety guarantees is a trade-off worth making?

                                                On the other side are the people that enjoy strong typing but don’t want to interact with the borrow checker, here Nim may be more of an option. Meanwhile Deno/Typescript, Ruby and Python are still staying strong in that field.

                                                Garbage collection is certainly another viable approach to the problem of memory safety. Though, some may argue that GC pauses are inappropriate for an embedded system running some sort of real-time application.

                                                And replacing numpy with a rust-ish library sounds nice. But we shouldn’t forget that there are still loads of Fortran libs underneath those heavily utilized python libs.

                                                I believe Fortran is relatively safe. IIRC the speed of Fortran arises from aliasing not being allowed in the language.

                                                Zig is cool, but the size of its user base is much smaller than Rust’s, ergo I expect more effort to be poured into the Rust language.

                                                1. 2

                                                  That valuing performance over safety guarantees is a trade-off worth making?

                                                  Sometimes it is. Sometimes, if you don’t prioritize performance, the code is incorrect, and the fact the code is safer doesn’t make it correct. Just buying a faster processor isn’t always a solution, either.

                                                2. 7

                                                  Yeah, Rust is more of the C++ replacement than C.

                                                  1. 14

                                                    Rust has attracted a lot of people (including me) who wanted a better C, and don’t think that C++ is a better C.

                                                    I agree that zig is closer to being a direct C replacement. However, after using Rust I also got used to quality-of-life improvements it brings, so there’s no going back for me :)

                                                    1. 4

                                                      But D though… >_<

                                                    2. 2

                                                      I am unsure if Zig can take the lead in replacing Rust. Successfully replacing a language such as C, in my opinion, can only be a combination of (1) a strong value proposition, (2) ability to gain traction within a developer community, (3) gain traction in larger organisations. I believe the first aspect, both Rust and Zig has. What I believe Rust has, that makes it a prime candidate for replacing C in some ares, is that it has a very strong developer community that is develops integrations into wide variety of developer tools (e.g. IntelliJ Rust support), a strong ecosystem (crates.io, cargo) and advocates highly for it. In addition, it gains tractions within larger organisations and allows people to work paid on the Rust ecosystem. While Zig might be better suited, in my opinion, other factors play a significant role where Rust is really strong atm, in addition to have a strong value proposition.

                                                    1. 1

                                                      w.r.t the lack of package management for Guile, have you looked at akku.scm?

                                                      1. 2

                                                        Yeah. And guild hall as well. Akku is the more promising one, but I think the problem is it will take some years it gains the momentum of something like Quicklisp. That’s probably a never though. For Guile I think Guix is the best option since with it you can combine C builds effortlessly, but for scheme in general Akku seems very, very promising.

                                                        Huh, I totally forgot to mention in the blog entry that CHICKEN is also a fantastic scheme implementation. Guile is a bit easier on the developer, but if you look close enough, they both are very practical though CHICKEN is more standalone, and I think there are some German companies actually using it in production.

                                                        1. 1

                                                          I love CHICKEN as a Scheme implementation. The package manager there feels quite a bit more like Quicklisp than, say, Akku. Gerbil/Gambit is another Scheme I’m fond of, though it lacks the community aspect I associate with CHICKEN.

                                                      1. 41

                                                        An independent web browser that isn’t based on Google-funded code and has full keyboard control.

                                                        1. 6

                                                          While its not a single platform, you might interested in tridactyl. Its a firefox extension, some of its greatest hits:

                                                          • Vim style keybinds (link navigation. element selection, scrolling, tab/buffer switching)
                                                          • Allows integration with the underlying system using a native messenger. You can send a youtube video to mpv, or pass in a region of text to an text to speach engine.
                                                          • Keybinds are user definable and can be composed. E.g. do x then y pipe that to z.
                                                          • Ever want to edit a text block (like this) in the editor of your choice? Just hit ctrl + i
                                                          • custom color themes
                                                          • Has a scriptable way to define new functions, albeit a little messy. e.g.
                                                            alias tabsort jsb browser.tabs.query({}).then(tabs => tabs.sort((t1, t2) => t1.url.localeCompare(t2.url)).forEach((tab, index) => browser.tabs.move(tab.id, {index})))
                                                            will define an alias for tabsort that, well sorts tabs by domain name.

                                                          I’m not related to the project, but I do sing its praised every change I get.

                                                          1. 1

                                                            Thanks; I’ve heard of this but A) I don’t use vim or want to learn it and B) it runs on a browser whose rendering engine just had its entire team get fired and C) it’s also a google-funded browser.

                                                          2. 5

                                                            Your wording allows currently Apple-funded WebKit (and I think there are some WebKit wrappers that qualify already), is it intentional or not?

                                                            1. 2

                                                              Given that webkit was the original rendering engine for Chrome I would not count it as being independent, no.

                                                              I mean, I still use it, but I would prefer to have a healthy selection of engines rather than just a bunch of Chrome descendants.

                                                              1. 9

                                                                Technically, Google did not do any work on WebKit, it just added V8, then later forked the thing. So it’s all descendants of KHTML → WebKit, with Google being of no use for WebKit proper. And Gecko, which I guess can also plausibly be called Google-funded…

                                                                [the problem, of course, that with people saying «Living Standard» without noticing it is an oxymoron, any browser will either have large compatibility issues, even if the good side of the Web is viewable even in Links2, or be a horrible mess because it chases a moving target that moves too fast to have reflection on consistent design]

                                                            2. 4

                                                              qutebrowser

                                                              It was about a 3-day learning curve for me, but I’ve loved it ever since.

                                                              Full keyboard control, but some things you can’t do with the mouse :)

                                                              1. 4

                                                                Qt WebEngine, which is what Qutebrowser runs on, is essentially just Chrome’s layout engine. Nearly everything is Chome nowadays.

                                                                1. 1

                                                                  You’re right about the layout engine, but it’s much better than Chrome all-around. No phoning home, built-in adblock, respect for keyboard user.

                                                                  1. 1

                                                                    It can also run on QtWebKit, but I think they’re going to phase that out, as it’s quite outdated.

                                                                    https://github.com/qutebrowser/qutebrowser/issues/4039

                                                                    1. 2

                                                                      I’m still not sure what to do about QtWebKit support - right now, I’m still waiting for something to happen (ideally a new QtWebKit release rebased on a newer upstream WebKit) given that it’s still in active (even though slow) development: https://github.com/qtwebkit/qtwebkit/commits/qtwebkit-dev

                                                              1. 5

                                                                Is there a tl;dr on how to check for the rootkit?

                                                                1. 2

                                                                  From the NSA disclosure:

                                                                  If the following commands are run on the command-line and the “testfile” disappears, the system is infected with Drovorub. If the “testfile” does not disappear, the system may still be infected with Drovorub. The signature “ASDFZXCV” could have changed or the pseudo-device used for host-based communications between Drovorub-client and Drovorub-kernel module could be something other than /dev/zero.

                                                                  touch testfile
                                                                  echo “ASDFZXCV:hf:testfile” > /dev/zero
                                                                  ls
                                                                  
                                                                1. 2

                                                                  Moving to college, apparently.

                                                                  1. 1

                                                                    Good luck, stay safe.

                                                                  1. 12

                                                                    A bit click-baity, no?

                                                                    However, it doesn’t prove that there’s no faster way to do it.

                                                                    1. 4

                                                                      Yeah I found the article really confusing - it seems to pretty clearly say that there’s no proof that this is the best possible (though it sounds like there are some indications that it may be) and then ends with “Regardless of what computers look like in the future, Harvey and van der Hoeven’s algorithm will still be the most efficient way to multiply.”

                                                                      1. 1

                                                                        We keep saying that we can’t do it faster, yet we’re continually making it faster.

                                                                    1. 2

                                                                      Before I go into the source code

                                                                      No proper booleans. Like in C, anything that is not nil (NULL), the empty list, is considered to be a truthy value.

                                                                      This is incorrect. CL has booleans, it is just not idiomatic to use them. Instead one uses generalized booleans

                                                                      CL-USER> (typep t 'boolean)
                                                                      T
                                                                      CL-USER> (typep nil 'boolean)
                                                                      T
                                                                      CL-USER> (typep 1 'boolean)
                                                                      NIL
                                                                      

                                                                      I am a little disappointed that the (coerce pixels ’list) is necessary. Vectors are proper sequences in Common Lisp, but {} only works on lists.

                                                                      Yes, that is something I wish CL would do different as well. Another place you encounter this is in the :collect clause of the loop macro, it only works with cons cells. If one wants to incrementally build a vector One has to wrap the loop with a call to coerce. Iterate solves that, although I just live with (coerce (loop …) ’vector)

                                                                      Sadly, that’s where the niceties end. t is a typical name for the variable in a parametric equation, but it’s also the name of the canonical “true” value in CL, so you can’t use it as the name of a parameter.

                                                                      If one used packages one would be able shadow the t symbol refer to the boolean with a package prefix, cl:t. I would just use another name for the variable but the option is there if one wants to do it anyway.

                                                                      Another difference in naming convention is that Common Lisp hackers, for some reason, avoid using -> to denote conversions

                                                                      The reason is because the standard doesn’t use ->, ej. char-code not char->code. Yes it is unfortunate, -> is more clear. Some people use it anyway.

                                                                      Finally the benchmark is including the time that it takes to do IO, I wouldn’t do that.


                                                                      From the code one can see the author mostly writes scheme. Although they made an effort to use format and loop, the code is not written in an idiomatic manner. Mostly minor details. Not using a package. Using defvar instead of defparameter for what are effectively program constants. Not using earmuffs for dynamically scope variables. Naming the predicate some-p instead of somep. The whole option implementation at the start of the code. Running the code when loading the file as opposed to wrapping it in a function. This are all minor details. There are a couple things that are important though:

                                                                      • If they cared about performance they wouldn’t have used structures to represent vectors, instead they would have used vectors! They could have used a library like https://github.com/cbaggers/rtg-math. They said quicklisp was fair game after all.

                                                                      • Unlike the scheme code, they are using single-floats in CL, I doubt they want to do that. The numbers should be written as 1.0d0 to specify double floats or one can change the value of *read-default-format*

                                                                      Still, I would like to thank the the author for taking the time and effort to write a small raytracer in several languages to compare them. It certainly took more effort to write that this comment.

                                                                      1. 2

                                                                        This is incorrect. CL has booleans, it is just not idiomatic to use them.

                                                                        I raise you a counterexample:

                                                                        * (typep t 'symbol)
                                                                        T
                                                                        * (typep nil 'list)
                                                                        T
                                                                        

                                                                        The sentence following “[n]o proper booleans” is my definition of what makes an implementation of a boolean data-type “improper”, which rehashes what you’ve linked about generalized booleans. I suppose it is a bit objective, but this is meant to be a largely objective article anyway.

                                                                        Aside from that, thank you for the comments on how the implementation could be more idiomatic. I’ll go back and adjust the specific things you pointed out for anyone looking at the comparison, and update my rather hand-wavy benchmark.

                                                                        1. 1

                                                                          The sentence following “[n]o proper booleans” is my definition of what makes an implementation of a boolean data-type “improper”

                                                                          Like in C, anything that is not nil (NULL), the empty list, is considered to be a truthy value.

                                                                          I’m not clear on what that definition is if the CL definition doesn’t match it. The type boolean is an exhaustive set of two values, (deftype boolean () '(member t nil)). Why does it matter that said members are also members of other types?

                                                                          You could have a strict variant of if that would only accept booleans in the test-form. The fact that other language constructors operate on generalized booleans is unrelated to having booleans as a proper type.

                                                                          Then again I may not be clear as to what distinction you are drawing as I don’t see the value(🥁) of booleans. In the context of application development, Generalized booleans are better for any use case I can think of. Even in typed languages like SML, I would avoid booleans in favor of enumerations. They are ok as the return value of predicates, but that’s it. People misuse booleans all the time, ej. use them as a field in their model. But that is unrelated to the purpose of your article.

                                                                          1. 1

                                                                            I’m not clear on what that definition is if the CL definition doesn’t match it. The type boolean is an exhaustive set of two values, (deftype boolean () ’(member t nil)). Why does it matter that said members are also members of other types?

                                                                            It doesn’t really matter. It’s a triviality, but nonetheless a difference between Common Lisp and Scheme. I wanted to outline differences.

                                                                            You could have a strict variant of if that would only accept booleans in the test-form. The fact that other language constructors operate on generalized booleans is unrelated to having booleans as a proper type.

                                                                            Then I suppose my comment relates to language constructs operating on generalized booleans, rather than the existence of a boolean type. Do you feel I should be more explicit about that?

                                                                            Then again I may not be clear as to what distinction you are drawing as I don’t see the value(🥁) of booleans. In the context of application development, Generalized booleans are better for any use case I can think of. Even in typed languages like SML, I would avoid booleans in favor of enumerations. They are ok as the return value of predicates, but that’s it. People misuse booleans all the time, ej. use them as a field in their model. But that is unrelated to the purpose of your article.

                                                                            I’m not necessarily defending Scheme’s approach to booleans. I agree with you 100%.

                                                                            1. 1

                                                                              It’s a triviality

                                                                              I wanted to outline differences.

                                                                              Do you feel I should be more explicit about that?

                                                                              Like you said, it is not central to the article. If the goal is to outline the differences I would only mention that nil is both false and the empty list. I would focus in another big difference that you don’t mention, ‘modules’ (in the broadest sense of the word). From what I know of Racket, modules in Scheme are tied to files. While the mechanism in CL is packages, which is also a factor in the need for macro ‘hygiene’.

                                                                              But that is mostly beside the point. The article is already good as it stands. It has taken you at least a couple of weekends to write and it was more enjoyable that the low-effort medium rant about. So again thanks for taking the time to do so.

                                                                              1. 1

                                                                                But that is mostly beside the point. The article is already good as it stands. It has taken you at least a couple of weekends to write and it was more enjoyable that the low-effort medium rant about. So again thanks for taking the time to do so.

                                                                                Even if rant-y, I think I got quite a bit out of this. Thank you.

                                                                                I’ve just pushed the changes you suggested (with the exception of using bagger’s library, I’ll try this tomorrow).

                                                                      1. 1

                                                                        I’ve been unknowingly using Emacs Lisp since much earlier – not in the sense of writing packages – my old man taught me how to use Emacs when I was nine

                                                                        (This makes me jealous)

                                                                        I decided to scrap my BMP encoder and go with PPM instead. Netpbm is text-based

                                                                        I was playing around with a NetPPM encoder myself in Scheme, just a few weeks ago, having have read the same article, and storage-wise, it’s helpful to remember that NetPPM can also be generated using binary data. The header stays the same, but after the P6 100 200 256 part, you just write bytes.

                                                                        Clojure’s license makes it a complete non starter for me, sorry. Live free or die.

                                                                        What’s this about? I recently read RMS saying that an argument to not consider Clojure a proper lisp is that it’s (allegedly, idk) based on cons-cells, so that “the most basic programming techniques of Lisp don’t work in Clojure”.

                                                                        1. 6

                                                                          What’s this about?

                                                                          EPLv1 isn’t GPL-compatible. Not totally evil, but it’s enough for me to want to avoid using it.

                                                                          https://www.eclipse.org/legal/eplfaq.php#GPLCOMPATIBLE

                                                                          1. 3

                                                                            Fun facts:

                                                                            • the EPLv2 is GPL-compatible
                                                                            • the Clojure developers have collected copyright assignment from all contributors, which would be needed to update the license to use it
                                                                            • despite this, the Clojure developers have indicated that they are uninterested in doing so
                                                                            1. 1

                                                                              Would it make you feel better or worse if it were MIT?

                                                                              1. 2

                                                                                If Clojure were licensed under MIT? I would feel better, as it’s compatible with the GPL.

                                                                            2. 3

                                                                              If you’re interested in Clojure, by the way, Phil Hagelberg (who wrote Leiningen, the standard Clojure build tool) is nowadays contributing a lot to Fennel (which is also mentioned in the article, and compiles down to Lua).

                                                                              Libre Lounge has a really fascinating interview with him that covers that topic – caveat auditor, I ended up buying his Atreus keyboard after listening to the podcast.

                                                                              1. 5

                                                                                Careful, for he lurks among us. Some say that if you say the word “technomancy” out loud three times he may appear.

                                                                              2. 2

                                                                                From what I can see, Clojure uses the Eclipse Public License? (based on https://github.com/clojure/clojure).

                                                                                Is the EPL that problematic?