Fork me on GitHub
#off-topic
<
2022-02-18
>
Drew Verlee05:02:32

I would like to increase the terseness of my code, i would love for the biggest ROI for that to be the clojure.core lib, but often the business code is the biggest area where this can be imrpoved. But i like the symbol for reduce (see above picture), i might have to do that on emacs.

adi07:02:41

Obligatory reference to Notation as a Tool of Thought https://dl.acm.org/doi/pdf/10.1145/358896.358899 Worth reading even if one won't ever program in an APL. (And to make it somewhat more concrete, a solution to Dismal Arithmetic https://gist.github.com/adityaathalye/e9c79dbf138090bb2c81cb4f0e2a2c28 v/s https://gist.github.com/adityaathalye/1a79089aa0da1e6c1596472c994efc2c.)

👍 1
seancorfield07:02:44

APL has fascinated me ever since I encountered it in the early '80s. I did my industrial placement "sandwich" year from university at an insurance company that used APL heavily -- my final year Comp Sci project was to write an APL interpreter (in Pascal!). I think it's an amazing language.

2
adi13:02:20

Well, the arc of history is a strange arc... https://gmcdavid.org/2021/06/05/another-undead-computer-language/ > And histories that have could have played out so much differently. In 1982, Bill Gates was doing a whirlwind tour of North America and swung by IP Sharp and Associates in Toronto. And there was a meeting between a few of the IP Sharp folks and Bill Gates. And Bill Gates was getting ready to make the PC amongst APLers and array programmers. There’s this anecdote of sort of Bill Gates for a long time was a big fan of APL and had an APL sort of handbook in his desk.

adi13:02:38

@U04V70XH6 APL is very much alive and kicking. People from Dyalog and from J Software have come every year to Functional Conf. This year, Aaron Hsu (Dyalog APL) is talking about "DSLs, Architecture, &amp; Structural Design in APL, 3 ways.", and Rodrigo S. (also from Dyalog) is talking about "Why APL is a language worth knowing" https://functionalconf.com/

quoll16:02:34

Some years ago I tried porting the https://www.youtube.com/watch?v=a9xAKttWgP4 into Clojure (using Java2D), and then a few years later I ported it to a web app. It’s such a cool presentation, and I had fun https://github.com/quoll/life. This inspired me to I bought the APL programming manual a short while ago. I’ve been tempted to buy a Dyalog keyboard (not necessary, but cool)

lightsaber 1
adi17:02:37

I love that demo. I've re-watched it and re-typed it several times :) One of my personal mind-melting moments with APL happened after stumbling on the idea of the inverse of a function. A function f composed with the https://help.dyalog.com/12.0/html/power%20operator.htmhttps://help.dyalog.com/12.0/html/power%20operator.htm and high-minus one ¯1 , becomes the inverse of f.

c←f⍣¯1                  ⍝ c is Inverse of f.
I used it like this, to implement a solution to Dismal Arithmetic:
da ← 10⊥(⌈/10⊥⍣¯1⊢)
      da 169 248
269
Explanation https://gist.github.com/adityaathalye/e9c79dbf138090bb2c81cb4f0e2a2c28#file-dismal_arithmetic-dyalog-L4.

seancorfield17:02:27

J looks like line noise to me -- it loses the elegance of the original APL symbols etc. Dyalog looks interesting -- I didn't know about that. Fonts and keyboard mappings too. Mmm, I may have to install that and take it for a spin... but my APL is going to be really rusty after the best part of 40 years away from it! 🙂

adi17:02:50

Back to the Game of Life example, this page discusses how to extend it to other kinds of surfaces: https://dfns.dyalog.com/n_life.htm The example in John Scholes's demo is a toroid, I believe. The page extends it to manifolds etc. (which I don't quite understand).

adi17:02:46

@U04V70XH6 Dyalog published this e-book: https://www.dyalog.com/mastering-dyalog-apl.htm They also have an APL interpreter online: https://tryapl.org/ And a pretty active "APL Orchard" chat on stack exchange: https://chat.stackexchange.com/rooms/info/52405/the-apl-orchard?tab=conversations

adi17:02:58

> my APL is going to be really rusty after the best part of 40 years away from it Now taking bets 10:1 odds against ;-)

seancorfield17:02:47

I'll let you know how it goes -- it'll be a while, I suspect. My weekends are pretty busy right now and I have several long trips planned over the next few months 🙂

1
Stuart13:02:57

I'm using github desktop, I tried to rollback changes to a file and got this message: What has my recycle bin got to do with rolling back changes on a file ?

p-himik13:02:06

Probably because they use the bin for discarding changes, as the error suggests?

Martynas Maciulevičius13:02:42

Maybe they decided that it's an appropriate place as it's probably swapped correctly... Do they appear in there? 😄 Or maybe they're mocking you that you're using their client? Could that mean that they know what your project is about? Did you enable autopilot? 😄

Stuart13:02:43

Yes, I get that they probably do that. But If I'm discarding changes on a file, this is something that I would expect can't be undone anyway. SO why does it matter

p-himik13:02:02

Because it can be undone. :)

Stuart13:02:30

> Or maybe they're mocking you that you're using their client? What do you use, learning the whole command line ? I've tried git within VS and VSCode but since they changed to using Access TOkens from username / password, I constantly run into auth issues

Stuart13:02:53

Putting them in the trash seems absolutely mental.

Stuart13:02:14

If you want to be able to rollback changes a rollback, you can't empty your trash bin? WHAT!

Stuart13:02:10

ALthough this might explain why a while ago I had low disk space issues and there was like 35GB in the trash bin.

Martynas Maciulevičius13:02:11

> What do you use, learning the whole command line ? I use linux and I only use the command line. I never liked the IDE approach. I only use meld when I merge files. And I stage my changes using git add -i. I hope this helps. I think you could do something similar by using cygwin or something similar. But it won't be easy on windows. 😕

pavlosmelissinos13:02:08

> since they changed to using Access TOkens from username / password, I constantly run into auth issues just use https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh with github > learning the whole command line it's not that hard and it's a great way to learn how to use git (most of these UI tools abstract away essential information and that cripples your understanding of how version control works)

p-himik13:02:11

Yeah, 95% of all the Git functionality that you use every day is just a tiny handful of what it can do, and the corresponding CLI commands are trivial. It becomes especially trivial if you use https://github.com/scmbreeze/scm_breeze

slipset14:02:08

I’m curious if the people that complain about the Clojure stacktraces have ever seen the compiler output from TS…

😄 1
☝️ 1
Pavel Meledin15:02:36

why compare with something worst ?

slipset15:02:37

Since worse is better?

seancorfield19:02:33

In my day... (adopts Yorkshire accent)... we used to print out hex/character core dumps and read through them page by page translating opcodes in our head and essentially "decompiling" back to COBOL to find the bugs 🙂

seancorfield19:02:44

Has the Scala compiler gotten any better in that area? Back when I last tried (2.9), the compiler errors from mismatched implicit type conversions in standard library calls on collections were just awful...

borkdude19:02:25

I know JS and Node.js aren't always loved by everyone but what I'm wondering about is, if you would sum up "Node.js, the good parts", what would be the replies? Answers in thread please.

Drew Verlee19:02:43

synergy with the javascript ecosystem.

Martynas Maciulevičius19:02:11

It has Typescript which is a type system. So specify... types. For specific type of people that like types. You type more and it doesn't prevent too much if you mistype things but it's better than no types at all. Also you can exit this type system if you want. Which means that it's flexible. So if you want types but you don't want types -- you're covered.

dvingo19:02:17

the original talk is pretty insightful https://www.youtube.com/watch?v=ztspvPYybIY the event loop vs threads for concurrency is the heart of it

🙏 1
quoll20:02:06

It’s extensible, if needed, and that has led to modules like fs meaning that you can really do whatever you want with it. And it’s ridiculously fast.

quoll20:02:44

Also having function as such a fundamental (and efficient) building block of the language has made it extremely easy to use JS as a target for other languages, like ClojureScript.

valtteri20:02:09

Despite all the horrible stuff.. There are also good things. JS has incredible reach. NodeJS is a good intro to async programming for those who are used to the luxuries of threads. Also JavaScript is super simple if you grab just the good parts and ignore the rest.

quoll20:02:09

I already mentioned that you can build your own modules in C (which has security and safety issues), but more recently it comes with WASM support. This means that you can build safe modules in a variety of other languages. This framework provides extraordinary flexibility

lilactown21:02:59

1. huge ecosystem & commercial support. basically, if you're a webdev, there's a Node.js tool that does what you want 2. pretty good performance 3. first class fns, async i/o 4. dependency management has pros and cons but IMO local node_modules is way better than global envs like python, and the hacks required to get around it

👍 1
lilactown21:02:56

☝️:skin-tone-2: i typed that up a couple hours ago and forgot to send. some other people seem to have said the same 🙂

mauricio.szabo01:02:26

I like the async approach of Node (like, you can't even exit the async world) so it's kind of a cheap way to not block your main thread at all

mauricio.szabo01:02:12

Also, it's a dynamic language that it's more explicit than implicit (I'm looking at Ruby, and things that magically appear from nowhere) and it does have a good debugging support from devtools (so I'm not forced to use a specific editor)

jaide02:02:36

I like that it’s flexible enough to support many different paradigms decently. For example I got really into FP through libraries like highland, rxjs, bacon, and ramda which is what lead me to seeking out a lang like Clojure. I also like its general hackability, there are so many options for so many different kinds of problems. It's a language that can grow with you. Just getting started? Imperative, top down coding is fine. Then there's the oop features when you're ready to see how far you can go, then FP when you decide maybe it's better not to use everything available all the time. It also hosts languages I enjoy like cljs and ReScript

kraf14:02:55

JS • ES6+ ◦ Arrow functions ◦ async ... await (Promises) ◦ Generators (`redux-saga` brings CSP to the frontend) • Great tooling ◦ eslint, prettier, debuggers, profilers, ... • Dynamic Node • Huge community • 10 different libraries for every single problem you can think of and many of them still maintained • Good concurrency model (personally big fan of CSP but Node's model is far better than threads and they have worker threads that are a good answer to the trade offs of the single thread imo) • Performance • Code sharing with frontend

borkdude14:02:21

Context: I'm asking for #nbb which is a CLJS scripting env on Node.js. The goal is to have Clojure for scripting (interpreted via SCI, no JVM) and leverage the good parts of Node.js, I'm trying to get a better image of what those good parts are. https://github.com/babashka/nbb

borkdude14:02:02

So far I've identified: • browser testing (Playwright) • lambda functions on cloud (AWS, Google) • TUI/CLI programs • large ecosystem

kraf14:02:18

nbb looks really interesting. Have you tried it with https://github.com/puppeteer/puppeteer yet? Could probably provide some really nice API for screenshotting websites or web scraping using this.

borkdude15:02:28

@U01DV4FGYJ0 it works well with puppeteer. At #nextjournal I've ported all their browser tests from compiled CLJS + Playwright to #nbb with Playwright and it needed minimal changes. Now they can just run, edit, run, without any additional tooling

borkdude15:02:53

There's both examples for puppeteer and playwright here: https://github.com/babashka/nbb/tree/main/examples

jaide15:02:17

That's great to hear! Used lumo + puppeteer to write an auto solver for the NYT spelling bee game

kraf15:02:00

Ohh I misunderstood. This is interpreting a subset of CLJS within Node.js? 🤯 This is awesome! So this allows you to call CLJS from Node directly? Does it allow CLJS libraries that you can require from Node too?

borkdude15:02:52

@U01DV4FGYJ0 Yes, iff the library sticks to the subset of CLJS that the interpreter supports. E.g. it can load honeysql from source. But it also comes with a set of built-in libraries for which that restriction doesn't hold: it can be any lib, advanced compiled and then optionally loaded.

borkdude15:02:31

Also: it can load any JS lib that works with Node, no restrictions there

borkdude15:02:57

Try npx nbb :)

🙏 1
jaide20:02:02

> • browser testing (Playwright) > • lambda functions on cloud (AWS, Google) > • TUI/CLI programs > • large ecosystem I foresee developing some applications with it using macchiato + nbb for web servers

jaide20:02:42

Though I have not explored macchiato so if not that explicitly, then a small lib to make express more like ring would be cool

borkdude20:02:59

I haven't tried macchiato with nbb, but #sitefox is a web framework that explicitly supports #nbb https://github.com/chr15m/sitefox/

jaide20:02:10

Cool, looks nice too

jaide20:02:50

Poking around, does look solid but I really do like the composition of middleware functions that operate on plain request map and return a plain response map

quoll20:02:47

I don’t know if this could go into #community-development, or #events, or somewhere else, but to be safe I’ll post it here. While we are still a long, long way from normal, we’re seeing a lot of things open up, and several conferences starting to have in-person attendance. I’m wondering about a future Clojure/conj. Has anyone heard what might be happening here? I know that this is not within your purview @alexmiller, but I also know that you speak to the people for whom it is, so maybe you’ve heard something?

quoll20:02:24

Or anyone else other than Alex, for that matter

Alex Miller (Clojure team)20:02:44

I'm not sure when we will make a decision on in-person for 2022, so can't answer yet, sorry!

👍 1
Alex Miller (Clojure team)20:02:13

certainly, there is a desire to do some in-person events, not just Conj which would almost certainly be in Durham, but another Clojure/south in São Paulo

dpsutton20:02:58

Normal time is winter for the conj right? (would absolutely love a trip to Såo Paulo)

quoll20:02:09

Historically, end of November/beginning of December

dpsutton20:02:55

i haven’t been to any since 2016 😞 managed an alex miller conference hat trick that year though. Seattle, strange loop, and austin in the winter since i could drive there

quoll20:02:59

Alex often MCs the conj, but he is given a break from organizing for that conference (which he needs ❤️)

quoll20:02:11

Oh, that sounds cool. Who wouldn’t want to attend a conference in Brazil? 🙂

👍 1
Heather21:02:34

Oh man, I might need to get a new passport. I’ve been working on learning Brazilian Portuguese for over a year now (my husband speaks it).

brazil-parrot 2
mauricio.szabo01:02:53

Me, for example: I escaped the place 😄. (just kidding, I would travel for a Clojure Conj 🙂)

Alex Miller (Clojure team)21:02:37

I think we are at this point, unbound by "normal" :)

👍 2