1. 2

    Trying to get into Sindome at the moment, but haven’t had the time to really explore it. Maybe I’ll log on this weekend.

    1. 2

      I’ve found the Sindome community to be a bit harsh, so tread carefully there

      1. 1

        Thanks for the heads up, will do

    1. 2

      Taking some well-needed R&R by visiting home - cooking with parents, watching my brother’s basketball games, and maybe doing a crackme or two. Currently amid exams at uni and nearly all of my time this past week has been spent studying. The two I’m taking this coming week are for my easier classes, though, so I think I can get by with just an hour or two of studying daily.

      1. 11

        A post about a game written in Lisp, firmly on the front page. Welp. Looks like I’ve found where I belong.

        Fennel is a dialect I’ve heard a lot of good things about. You might also like Lumen, which compiles to both Lua and JS. https://github.com/sctb/lumen

        I’ve been making some interactive docs for it: https://docs.ycombinator.lol

        1. 3

          Welcome to lobste.rs! I’ll be sure to look into Lumen at some point, JS as a target is always a huge plus for me, and the macro system seems to be a little more pleasant than Fennel’s. Did you compile the REPL to Javascript for the interactive part of those docs?

          1. 5

            FWIW Fennel works well in the browser as well; in fact it lets you use coroutines for scripting pages which can make for really nice control flow: https://github.com/technomancy/fennel-lang.org/blob/master/repl.fnl

            1. 1

              Didn’t realize that Fennel played so well with Fengari, that’s great to hear. My impressions of Fennel improve by the hour, it seems :)

              1. 2

                I’m thinking I should do a write-up of how the repl tutorial on https://fennel-lang.org is implemented, because it’s a really great fit for coroutines, and that’s always a topic I get a lot of questions about. They’re not widely supported in other languages, but they make a lot of tasks dramatically cleaner!

                1. 1

                  They definitely do, I’d love to see an article from you about them!

            2. 4

              Correct. lumen.js weighs in at 1,348 lines, and the compiled output is a direct consequence of what the source code looks like: https://github.com/sctb/lumen/blob/master/runtime.l

              In fact, you can just copy-paste lumen.js into a Chrome REPL to get the runtime going. (It’s not much harder to get the reader + compiler as well, but those are separate files.)

              If you want to see a neat example of Lumen’s flexibility, check out the vanishing source code trick. https://news.ycombinator.com/item?id=17963471

              To get a REPL that runs in the browser, I use browserify on the concatenated compiled output. I’ve been meaning to clean up the code and make it a reusable React component.

              Welcome to lobste.rs!

              Thanks! The front page is shockingly high quality, which is probably a consequence of all the interesting people here.

              1. 3

                Awesome, very neat consequence of a self-hosted implementation :)

          1. 9

            my desktop

            I do almost everything in Emacs at this point, IRC and Gopher being shown in the screenshot. As much as I love the Lobste.rs Gopher proxy, I don’t use it on a day-to-day basis, I just have the window up so there’s more than just ERC. I prefer to use elfeed to fetch posts from here.

            1. 4

              Oh, that looks nice. I haven’t used or thought about Gopher since the mid-1990s, so I’ll check that and elfeed out – thanks! I have been using eww to read Lobsters and Ars in emacs, supplemented with Firefox as needed.

              Here’s my desktop. I’ve done a lot of desktop- and distro-hopping over the last few years – bounced around between OS X, Windows, Linux, and FreeBSD – but seem to have settled on Fedora’s KDE Plasma spin. I’m a fan of i3, LXDE, and Xfce, but Plasma is very pretty and customisable. Apparently, there’s a way to enable emacs key bindings in KDE. I tend to prefer command-line and ncurses over graphical interfaces, but switch between them both. Plasma dark theme is nice, but it can be little hard to see dark icons and controls. I usually have the default Windows 10 (abstract blue logo) background on all my desktops, because it’s quite beautiful, and provides urban camouflage at work.

              1. 2

                If looking into Gopher, you might find this enlightening. Here’s a Wikipedia conversion, too. The main site I found for searching Gopherspace or finding servers was FloodGap. Since Lynx supports Gopher, just open it in terminal and type gopher://floodgap.com. You’ll get a gophersite immediately with text, menus, and so on. If you don’t have it, Lynx should be in your distro’s package manager already since it’s really popular.

                1. 1

                  Very nice, this is one of the better looking KDE setups I’ve seen. Gopher’s experienced somewhat of a renaissance recently, so I’d say checking it out again is a good idea. Plenty of new gopherspaces to explore

                2. 1

                  The window manager is dwm, right? I’ve been using XFCE for a while now, since usually more “advanced” window managers messed around with Emacs keys. Did you have a similar issue/could you solve it?

                  I’m getting a new SSD soon, so I might invest some time in setting up a better WM, and since Emacs is 80-90% of my workflow, being able to properly use it is crucial.

                  1. 1

                    Yep, dwm. I have the super key configured as dwm’s modkey, and don’t use any keybindings in Emacs that use super, so I haven’t had any personal issues with it. Can’t vouch for it as I haven’t used it, but I’ve heard that exwm is quite good if you’re concerned about Emacs keybindings being clobbered by the window manager, and ratpoison prides itself on having “a prefix map to minimize the key clobbering that cripples Emacs and other quality pieces of software.” Might be worth looking into, but again, I don’t have much experience fighting to get Emacs to play nicely with a window manager, so it would be wise to take my suggestions with a grain of salt

                    1. 1

                      The best thing I’ve heard for emacs users is to just use emacs as the wm.

                1. 7
                  • today was my bday
                  • Hiking tomorrow 9am.
                  • A friend who is a piano teacher is having a school recital at 530pm which includes her students. Going to watch.
                  • Play some lichess vs comp.
                  • Sunday visit parents
                  1. 2

                    Happy birthday! I’m visiting family this weekend as well :]

                    1. 1

                      Thanks so much!

                  1. 2

                    Weightlifting, running, cooking, learning 中文, and shredding drums. I’d like to branch out and try some new things, though, so I’m looking forward to reading through these comments

                    1. 1

                      Not sure if the author is on lobste.rs, but are there any plans to support Golang in the future?

                      1. 2

                        The author seems to encourage adding new languages on your own – see the “Adding a Language” section in the readme. If you end up implement support for Golang, I’d consider submitting it as a patch. I think there are a lot of people who would appreciate support for that out of the box

                        1. 1

                          Sadly, I’m not going to be able to make time for that :(

                      1. 7

                        I guess it depends on what you consider to be a wiki. I’ve got an org-mode knowledge base in ~/Notes that I treat like a wiki in the sense that I create in-line hyperlinks whenever the name of an “article” occurs in a sentence. It’s nice and structured to satisfy my obsession with everything being orderly, but in most situations I just use ag.el to find what I’m looking for.

                        1. 1

                          How do you add new stuff? Using captures, and if yes what’s your system? If not, what do you do?

                          I’ve been maintaining a “notes.org” file that consists of 90% stuff I looked up on the Internet when I needed it, in case I don’t have a connecting, and it’s basically just a list of headers. What I’m wondering is how to get started with a org-mode wiki.

                          1. 3

                            I’ll bite. My org usage has evolved, and what I describe will at best be the penultimate way of how i use it (i’m using penultimate ironically here, i’ve evolved my note usage so many times I can’t count).

                            What I do is use org like so (note, I use use-package heavily, adapt to fit, most of this crazy is me making things prettier):

                              (use-package org
                                :ensure org-plus-contrib
                                :bind (("C-c a" . org-agenda)
                                       ("C-c b" . org-iswitchb)
                                       ("C-c c" . org-capture)
                                       ("C-c l" . org-store-link)
                                       ("C-c p" . org-latex-export-to-pdf))
                               :config
                               (progn
                                 (custom-set-variables
                                  '(org-log-done t)
                                  '(org-hide-leading-stars t)
                                  '(org-hide-emphasis-markers t)
                                  '(org-confirm-babel-evaluate nil)
                                  '(org-capture-templates
                                    '(("t" "Todo" entry (file+headline "~/src/bitbucket.org/mitchty/org/gtd.org" "Tasks")
                                       "* TODO %?\n  %i\n  %a")
                                      ("n" "Note" entry (file+datetree "~/src/bitbucket.org/mitchty/org/notes.org")
                                       "* %?\nRandom Note entered on %U\n  %i\n  %a")
                                      ("m" "Todo from email" entry (file+headline "~/src/bitbucket.org/mitchty/org/gtd.org" "INBOX")
                                       "* TODO %?, Link: %a")
                                      ("u" "Url" entry (file+headline "~/src/bitbucket.org/mitchty/org/urls.org" "Urls")
                                       "* %u\n\n %i" :prepend t)
                                       ))
                                  )
                            
                                 ;; typing stuff like the mode for a snippet is for chumps
                                 (add-to-list 'org-structure-template-alist '("el" "#+BEGIN_SRC emacs-lisp\n?\n#+END_SRC" ""))
                                 (add-to-list 'org-structure-template-alist '("hs" "#+BEGIN_SRC haskell\n?\n#+END_SRC" ""))
                                 (add-to-list 'org-structure-template-alist '("pl" "#+BEGIN_SRC perl\n?\n#+END_SRC" ""))
                                 (add-to-list 'org-structure-template-alist '("py" "#+BEGIN_SRC python\n?\n#+END_SRC" ""))
                                 (add-to-list 'org-structure-template-alist '("sh" "#+BEGIN_SRC sh\n?\n#+END_SRC" ""))
                            
                                 (org-babel-do-load-languages 'org-babel-load-languages
                                                              (append org-babel-load-languages
                                                                      '(
                                                                        (C . t)
                                                                        (plantuml . t)
                                                                        (ditaa . t)
                                                                        (emacs-lisp . t)
                                                                        (haskell . t)
                                                                        (latex . t)
                                                                        (perl . t)
                                                                        (python . t)
                                                                        (ruby  . t)
                                                                        (shell . t)
                                                                        )))
                                 (add-hook 'after-init-hook (lambda () (org-reload)))
                                 )
                               )
                              (use-package org-bullets
                                :after org
                                :init
                                (custom-set-variables '(org-bullets-bullet-list '("・" "◦" "•" "◉")))
                                :config
                                (progn
                                  (add-hook 'org-mode-hook (lambda () (org-bullets-mode 1)))
                                  (when window-system
                                  (let* ((variable-tuple (cond ((x-list-fonts "Source Sans Pro") '(:font "Source Sans Pro"))
                                                               ((x-list-fonts "Lucida Grande")   '(:font "Lucida Grande"))
                                                               ((x-list-fonts "Verdana")         '(:font "Verdana"))
                                                               ((x-family-fonts "Sans Serif")    '(:family "Sans Serif"))
                                                               (nil (warn "Cannot find a Sans Serif Font."))))
                                         (base-font-color     (face-foreground 'default nil 'default))
                                         (headline           `(:inherit default :weight bold :foreground ,base-font-color)))
                                    (custom-theme-set-faces 'user
                                                            `(org-level-8 ((t (,@headline ,@variable-tuple))))
                                                            `(org-level-7 ((t (,@headline ,@variable-tuple))))
                                                            `(org-level-6 ((t (,@headline ,@variable-tuple))))
                                                            `(org-level-5 ((t (,@headline ,@variable-tuple))))
                                                            `(org-level-4 ((t (,@headline ,@variable-tuple :height 1.1))))
                                                            `(org-level-3 ((t (,@headline ,@variable-tuple :height 1.25))))
                                                            `(org-level-2 ((t (,@headline ,@variable-tuple :height 1.5))))
                                                            `(org-level-1 ((t (,@headline ,@variable-tuple :height 1.75))))
                                                            `(org-document-title ((t (,@headline ,@variable-tuple :height 1.5 :underline nil)))))))
                                  (font-lock-add-keywords 'org-mode
                                                          '(("^ +\\([-*]\\) "
                                                             (0 (prog1 () (compose-region (match-beginning 1) (match-end 1) "•"))))))
                                  )
                                )
                              (use-package ox-reveal
                                :after org)
                              )
                            

                            I store that all in a private git repo I host on my own site. I keep work and home separated in general.

                            Then I just link to files (the captures let me link to where I was in a file when I took the note, aka say i’m reading some source and have a “is this variable unsigned int or not, doesn’t matter, can check later” moment I can quick capture that and refile that away later.

                            Basically, I just capture notes and move them around so the agenda deals with things later. Tag stuff as appropriate so it shows up in the agenda and move on with life. YMMV though, I’m only 4 years into my org journey, so still at the beginner stage.

                            1. 1

                              I add new material by going to wherever I feel it belongs and writing a few sentences. The notes system I have is a little bit more flushed out than a knowledge dump, since I use it as a medium for exercising the philosophy that “if you can’t explain it simply, you don’t understand it well enough.” I suppose I do indirectly use captures, as that’s my way of adding to my GTD inbox, but I spend time processing any facts I put in there - either condensing them into something coherent for my notes, or creating an org-drill card.

                              My system might not be the best starting point if you’re looking to make a wiki using org-mode, since it’s largely tailored towards satisfying my obsessiveness. If you have issues with a single “notes.org” file, I’d recommend writing them down and thinking about how you might design an organizational system that doesn’t have those issues. Alternatively, you could look into packages that do the organization for you (e.g. org-brain). Best of luck in finding something that works for you.

                          1. 1

                            How is SBCL’s Windows support these days? The SBCL home page says it’s experimental. I ask because the article only recommended ClozureCL for Mac users.

                            Does anyone use CL to develop native mobile apps? mocl seems to be abandoned; the front page hasn’t been updated in years. Is there any practical alternative for iOS and Android?

                            1. 4

                              I think “experimental” is just a standard disclaimer. While SBCL’s Windows support is perhaps not at the Linux level it is pretty good. I’ve used threading and FFI without much issues years ago.

                              Would I use SBCL on Windows in production when money is at risk? I don’t know, I would extensively test it then. (But I wouldn’t use Windows when money is at risk anyway.)

                              1. 1

                                As I understand, ECL works for iOS and Android. Quoting the article:

                                ECL can be embedded in a C program, and can translate Common Lisp code to C code.

                                1. 1

                                  I’d be interested in hearing about CL on mobile as well. Kawa Scheme can run on Android/Dalvik, but can ABCL?

                                1. 6

                                  I would also like to share this log from the epic epoch date of 123457890 (i.e. February 13, 2009) and its eponymous channel.

                                  http://jordi.platinum.linux.pl/1234567890_prelim.txt.gz

                                  1. 3

                                    I never thought I’d be nostalgic for the days I hung around IRC channels hosting crass conversation like these, but here I am, skimming through these logs and fighting to hold back a smirk

                                  1. 4

                                    I’m not particularly proud of anything I’ve written, but I suppose I’ll link anyway since my post on Rust seemed to get some attention.

                                    http://jakob.space/blog

                                    1. 2

                                      These are a lot of interesting pictures and diagrams - is there a video of a presentation to go with this?

                                      1. 6

                                        I haven’t watched the entire thing yet, so I’m not certain, but I believe this is the recording: https://www.youtube.com/watch?v=-7GMHB3Plc8

                                        1. 1

                                          Ahhhh thank you

                                      1. 2

                                        Is there a way to print a string in Rust that generates simpler assembly? Would avoiding the println! macro achieve that?

                                        1. 2

                                          I looked into it and it seems that there is. It’s still a little more convoluted than the C example because it has to allocate a handle for stdout, but I think that it’s an improvement over what’s there right now. I’ll make an edit, thank you for the suggestion :)

                                        1. 4

                                          Nice article. How do you feel about the size of the language? One thing that keeps me off from looking at rust seriously is the feeling that it’s more of a C++ replacement (kitchen & sink) vs a C replacement.

                                          The Option example feels a bit dropped off too early, you started by showing an example that fails and then jumped to a different code snippet to show nicer compiler error messages without ever going back and showing how the error path is handled with the Option type.

                                          You should also add Ada to the list of your languages to explore, you will be surprised how many of the things you found nice or interesting were already done in the past (nice compiler errors, infinite loop semantics, very rich type system, high level language yet with full bare metal control).

                                          1. 2

                                            Thank you for commenting! I agree that Rust’s standard library feels as big as C++‘s, but I haven’t been too bothered by the size of either one. To quote Bjarne Stroustrup’s “Foundations of C++” paper, “C++ implementations obey the zero-overhead principle: What you don’t use, you don’t pay for [BS94]. And further: What you do use, you couldn’t hand code any better.” I haven’t personally noticed any drawbacks of having a larger standard library (aside from perhaps binary size constraints, but you would probably end up including a similar amount of code anyway, just code that you wrote yourself), and in addition to the performance of standards-grade implementations of common data structures, my take on it is that having a standardized interface to them improves readability quite a bit - when you go off to look through a codebase, the semantics of something like a hashmap shouldn’t be surprising. It’s a minor draw, but I feel like I have to learn a new hash map interface whenever I go off to grok a new C codebase.

                                            I’ll definitely take a look at Ada, seems like a very promising language. Do you have any recommendations for books? I think my friend has a copy of John Barnes’ Programming in Ada 2012 I can borrow, but I’m wondering if there’s anything else worth reading.

                                            Also, thank you for pointing out the issue with the Option example, I’ll make an edit to the post at some point today.

                                            1. 5

                                              It’s funny how perspectives change; to C and JavaScript people, we have a huge standard library, but to Python, Ruby, Java, and Go people, our standard library is minuscule.

                                              1. 2

                                                I remember when someone in the D community proposed to include a basic web server in the standard library. Paraphrased:

                                                “Hell no, are you crazy? A web server is a huge complex thing.”

                                                “Why not? Python has one and it is useful.”

                                              2. 2

                                                What you don’t use, you don’t pay for [BS94]

                                                That is true however you have little impact on what others use. Those features will leak into your code via libraries or team mates using features you might not want. Additionally when speaking about kitchen & sink I didn’t only mean the standard library, the language itself is much larger than C.

                                                I think my friend has a copy of John Barnes’ Programming in Ada 2012 I can borrow, but I’m wondering if there’s anything else worth reading.

                                                Last I did anything related to Ada was somewhere around 2012. I recall the Barnes books were well regarded but I don’t know if that changed in any significant way.

                                                For casual reading the Ada Gems from Adacore are fun & informing reads.

                                                1. 2

                                                  I’ll definitely take a look at Ada, seems like a very promising language. Do you have any recommendations for books? I think my friend has a copy of John Barnes’ Programming in Ada 2012 I can borrow, but I’m wondering if there’s anything else worth reading.

                                                  I recommend Building High Integrity Applications in SPARK. It covers enough Ada to get you into the meat of SPARK (the compile time proving part of Ada) and goes through a lot of safety features that will look familiar after looking at Rust. I wrote an article converting one of the examples to ATS in Capturing Program Invariants in ATS. You’ll probably find yourself thinking “How can I do that in Rust” as you read the book.

                                              1. 2

                                                Nice article thanks. I liked your very rational approach to evaluating the language. Way too much programming language comparison seems more ego driven than fact driven and it’s nice to see it done cheerfully and without team calling.

                                                1. 1

                                                  Thanks for the feedback! I’ll be sure to keep that in mind when I go off to write more posts like this

                                                1. 8

                                                  Glad you liked TRPL! I agree that some of the examples can be too abstract at times, it’s tough. Totally open issues if you want to talk about it; I’m open to improving things, but I’m also pretty particular about the book.

                                                  1. 1

                                                    Glad to hear confirmation that the book is open to those kinds of suggestions :) And I can totally understand being particular about something like that, hopefully I’ll be able to offer some analogies that are up to snuff

                                                  1. 2

                                                    This brings on some serious nostalgia, geez. I think I could appreciate this as a custom CSS.

                                                    1. 4

                                                      it’s far more than custom CSS though: there’s a shitload of routing evil going on to make the .php URLs work, and the HTML is prosilver (or subsilver, can’t remember which) grafted onto the .erb files

                                                      it’s an EVIL hack

                                                    1. 2

                                                      Fascinating exploration of one of the many clever techniques that made Wolf3d possible. I would love to see more explorations of historical code like this.

                                                      1. 3

                                                        Don’t know if this is what you’re looking for, since it focuses more on the hardware hacky stuff, but it’s a book I’d highly recommend.

                                                        https://www.amazon.com/dp/B0768B3PWV

                                                        1. 1

                                                          Super interesting. Thanks!

                                                      1. 7
                                                        1. 3

                                                          It is a great logo!

                                                          1. 1

                                                            I feel like there’s a reference I’m missing. :-)

                                                            1. 1

                                                              Simon’s Cat I’m guessing?