spdegabrielle
2020-10-20 08:34:59

Racket Users virtual meetup 28 November

Platform to be decided; zoom / jitsi / ? - suggestions please — 30 Minutes 1pm Pacific Time 9pm UK time (contact me so we can work out when this is in your time zone)

— If this is problematic let me know

  • this is intended to become a regular thing - maybe every 6–12 weeks

Kind regards

Stephen & Sam Phillips (Not posting in racket-news yet because really need feedback on what platform people prefer? Zoom/Jitsi /gather.town/or something else)


soegaard2
2020-10-20 09:31:31

system-type returns 'unix, 'window or 'macosx. Is there a way to differentiate between Arch, Debian and Ubuntu?


laurent.orseau
2020-10-20 09:33:26

On linux, uname -a should give you most of the info you want. However, I can’t tell you how to parse it properly.



soegaard2
2020-10-20 09:34:00

Are you Debian? What’s your output?


laurent.orseau
2020-10-20 09:34:48

Linux <my-machine-name> 5.4.0-52-generic #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux


spdegabrielle
2020-10-20 09:35:29

How about /etc/lsb-release ? I’m just about to check it give me a moment


laurent.orseau
2020-10-20 09:35:50

lsb-release may not work with all distros IIUC


soegaard2
2020-10-20 09:37:15

So for Ubuntu I can simply search for the string “Ubuntu”. That’s simple enough.


laurent.orseau
2020-10-20 09:37:44

that should work I guess


laurent.orseau
2020-10-20 09:38:14

uname -v should actually be enough: #57-Ubuntu SMP Thu Oct 15 10:57:00 UTC 2020


laurent.orseau
2020-10-20 09:38:55

uname -i gives you the architecture: x86_64


soegaard2
2020-10-20 09:39:36

It’s for flomat turns Debian and Arch name the libraries differently (sigh).


laurent.orseau
2020-10-20 09:40:02

sigh sigh indeed


laurent.orseau
2020-10-20 09:40:28

Debian should also have the name Debian somewhere in uname -v


soegaard2
2020-10-20 09:41:03

Cool. So now I only need to check whether Arch behaves nicely as well.


soegaard2
2020-10-20 09:41:55

laurent.orseau
2020-10-20 09:43:01

Found on the internet: uname -r Linux archlinux 4.16.13-2-ARCH


laurent.orseau
2020-10-20 09:44:24

Maybe make sure to fail with an error in case neither Debian, Ubuntu and ARCH are not found :wink:


pocmatos
2020-10-20 09:56:14

Don’t count on that.


pocmatos
2020-10-20 09:56:26

I am on arch: uname -r 5.8.12-arch1-1


pocmatos
2020-10-20 09:56:36

So… the string is not necessarily archlinux.


laurent.orseau
2020-10-20 09:57:00

the other examples have ARCH, not archlinux


laurent.orseau
2020-10-20 09:57:21

but yeah, caps/no caps difference anyway.


soegaard2
2020-10-20 09:57:27

I used “uname -a”. Downcased the string. Then searched for “arch”, “ubuntu” and “debian”.


pocmatos
2020-10-20 09:57:53

That would work over here: ~ uname -a Linux andromeda 5.8.12-arch1-1 #1 SMP PREEMPT Sat, 26 Sep 2020 21:42:58 +0000 x86_64 GNU/Linux


laurent.orseau
2020-10-20 09:58:13

@soegaard2 Could there be a more straightforward (and maybe more general) way to solve your problem, that doesn’t involve the OS name?


soegaard2
2020-10-20 09:58:55

I suppose I could distribute the actual library used, but not being on Linux I hesitate to do that.


laurent.orseau
2020-10-20 09:59:23

I meant, checking for lib names directly


pocmatos
2020-10-20 09:59:25

I think this arch1 is due to using a patched version of the kernel by arch. If I build a custom vanilla kernel, you might not see the string, even if I am on arch, so it doesn’t feel bullet proof btw.


soegaard2
2020-10-20 09:59:50

Also a parameter holding the library name is probably a good idea - but I think I need the OS name to pick a reasonable default.


laurent.orseau
2020-10-20 10:08:00

What about a more straightforward check: perform a simple operation on matrices to check whether the correct version on the library is installed. If not, output a meaningful error message saying how to resolve?


laurent.orseau
2020-10-20 10:09:14

or even try to load a different lib if cblas_scopy can’t be found?


soegaard2
2020-10-20 10:13:45

That sounds good too. But I already committed the other approach :slightly_smiling_face:


laurent.orseau
2020-10-20 10:14:25

(it just seems a little fragile)


soegaard2
2020-10-20 10:14:50

Agree.


feriattmac
2020-10-20 11:20:26

@feriattmac has joined the channel


greg
2020-10-20 12:45:53

Some years ago (5 or more?) there was an issue where Racket wanted a .so (for SSL??) that was named differently on both CentOS and Amazon Linux. I remember hacking an EC2 instance by just symlinking to the desired name.

But later that hack seemed unnecessary, it seemed fixed. I don’t know if it was resolved on the Racket end, or if so, how.

TL;DR There might be an example of how this sort of thing has been handled before, but my memory is vague.



george.privon
2020-10-20 13:21:59

Sounds interesting, but what’s the specific topic or aim? Is it a get-together/chat or will there be a talk or specific theme for each gathering? FWIW, i did like the gather.town environment of RacketCon


samth
2020-10-20 13:39:52

@soegaard2 yeah, my suggestion would be to just add more and more versions and library names


samdphillips
2020-10-20 16:29:02

This should be the correct answer, but apparently not all of the major linuxen could commit to actually making a uniform way to identify their platforms :face_with_rolling_eyes:


spdegabrielle
2020-10-20 16:30:32

It was a 30 second search. I want to do flyby PR’s on the offending distros, but I know they will be ignored.


spdegabrielle
2020-10-20 17:04:24

I’m thinking short ‘lightning’ talks(<5min), follows by discussion. Happy to go with what people think works best. I’m sure it will evolve.


greg
2020-10-20 17:52:49

has heard there are almost as many Linux distributions as there are flavors of BSD


soegaard2
2020-10-20 17:54:03

has heard there are even more versions of BLAS


greg
2020-10-20 17:57:48

waits for someone to suggest using Cantor diagonalization


soegaard2
2020-10-20 17:58:11

fetches popcorn


greg
2020-10-20 17:58:56

fortunately or unfortunately must leave to do a Zoom call


massung
2020-10-20 17:59:06

Emacs > Vim — there, I said it :wink:


greg
2020-10-20 17:59:24

:emacs:


ryanc
2020-10-20 18:08:39

You can use (system-type 'machine) to get the same output as uname -a without having to mess with external commands. But I agree with Sam, adding more version alternatives sounds like a better idea.


soegaard2
2020-10-20 18:10:03

@ryanc I think (system-type 'machine) only tells me it is a Linux machine. Not whether it is Arch, Debian or Ubuntu.


soegaard2
2020-10-20 18:10:44

My problem is that some systems use libblas and others libcblas.


soegaard2
2020-10-20 18:10:57

(different names for the same library)


soegaard2
2020-10-20 18:12:52

Well, at least on Debian. I think the others have libblas for the Fortran library and libcblas for the C one. But them amount of different versions of BLAS makes everything confusing.


kmallela
2020-10-20 18:20:54

@kmallela has joined the channel


badkins
2020-10-20 18:44:45

I get “Linux…Ubuntu SMP…” in my output.


soegaard2
2020-10-20 18:47:53

Oh! I totally missed that (system-type machine) returns a different result than (system-type 'machine). Now the comment @ryanc makes sense.


badkins
2020-10-20 18:51:32

I’m guessing you meant (system-type) vs. (system-type 'machine) because (system-type machine) gives an error for me.


soegaard2
2020-10-20 18:51:57

Yep.


soegaard2
2020-10-20 19:39:02

I have now changed the code to use (system-type 'machine) instead of calling out to uname.


gknauth
2020-10-20 20:04:06

Friday presentation coming up at work, another occasion to use glorious Slideshow. This time I want to pick a Matthew Butterick font. Does anyone have a favorite for use with Slideshow? There will be some Racket code in the presentation, a gentle intro to language-oriented programming.


gknauth
2020-10-20 20:14:17

gknauth
2020-10-20 20:42:07

I’ve tried so hard to be Vim-able. In IntelliJ, I’ve been giving Vim mode a fair trial. But honestly, after many months, I still find I do things faster when I use Emacs. IntelliJ’s Vim mode is complete, whereas its Emacs mode is fairly basic. I can function in Vim, but when I need to make a zillion changes quickly, I use Copy Path… in IntelliJ, go over to Emacs, and do the zillion edits I need to do quickly.


massung
2020-10-20 20:43:09

I actually love vim for most things (I do tons of ssh into remote machines type work). But for any Lisp code, etc. Emacs is just such a big win


gknauth
2020-10-20 22:45:24

It is good to know vi / vim, since by default it’s on every *nix machine.


winny
2020-10-20 23:26:17

About earlier — i think /etc/os-release might cover identifying most unix likes and distros.


badkins
2020-10-20 23:58:39

Nice! That’s a great way to find the version also.


samdphillips
2020-10-21 01:03:50

I haven’t used Emacs in ages, so when I need to make a zillion changes quickly I use vim :smile:


samdphillips
2020-10-21 01:06:09

That’s great thanks!


samdphillips
2020-10-21 01:06:47

Now I need to find out when everyone decided that would be a good idea.


samdphillips
2020-10-21 01:07:47

(aha systemd, figures)


samdphillips
2020-10-21 01:09:23

Probably only on machines with systemd , may be useful to have a Racket interface to https://www.freedesktop.org/software/systemd/man/os-release.html


cdep.illabout_slack
2020-10-21 01:48:38

@cdep.illabout_slack has joined the channel


ben
2020-10-21 02:47:06

Triplicate T4s


gknauth
2020-10-21 02:50:09

I make extensive use of Emacs macros, and I often write Lisp functions to do combinations of things to save me work.


moroze
2020-10-21 04:09:54

I have some code that compiles fine with raco make using standard Racket 7.8, but fails on Racket CS. It still runs fine when executed directly under racket with CS though. Here’s the backtrace, curious if this means anything to anyone? #&lt;procedure&gt;: arity mismatch; the expected number of arguments does not match the given number expected: 1 given: 2 compilation context...: /Users/noah/Research/shiva-opentitan/opentitan.rkt context...: make-arity-exn do-raise dynamic-wind start dynamic-wind do-compile-to-port dynamic-wind compile*-to-bytevector make-jit-on-call jitify-expr jitify-let jitify-expr jitify-top-expr loop [repeats 2 more times] thunk


moroze
2020-10-21 04:10:46

Haven’t had a chance to cut down to a minimal example yet unfortunately (I’m dealing with a big chunk of gnarly autogenerated code), and don’t have any particular reason to use CS so will likely go back to standard. Just wondering if I’ve hit some known issue or something that might be an interesting bug!


pocmatos
2020-10-21 05:54:09

I have managed to learn to do one thing properly in vim, quit. Always got stuck when using a new system, the thing starts vim by default and I have no idea how to get our of it, so I can finally export EDITOR=emacs. :slightly_smiling_face: