Fork me on GitHub
#off-topic
<
2021-09-29
>
dgb2308:09:59

On a recent application I made internal links as [↗️] with vertical-align: super; on a reporting page that only appear for certain types of users so they can jump to the underlying data directly. I made it so because I wanted to indicate that it is not a link that appears for general users (their clients) so it made sense to make them to look like something “extra” / “put on top”. But I agree that there is a baseline expectation that this would be an external link with a new tab in many cases.

dgb2308:09:28

(slack renders them a bit weirdly)

seancorfield17:09:37

That's a nice summary. I have the book and have read it a couple of times but it's good to see a "bullet point" summary of it like that.

dgb2321:09:20

How common is it to use JNI with a non-gc language for substantial parts of a Clojure program? Generally this paradigm/separation seems to be more common in other languages, from JS to Lua, Python etc. Say a full-on webserver, image processing, database layer, handling files… and then exposing a higher level api to the JVM/Clojure. One reason to do this might be performance, another one would be to use specific libraries. Am I correct with the assumption that performance (latency/throughput/memory) are not necessarily that large without considerable fine-tuning? Are there overhead costs? Might it be a much saner to let the JIT compiler to have more code to work with / know about? Asking purely out of curiosity, considering to maybe play with the JNI feature a bit. Happy to read about stories and opinions.

ghadi21:09:07

extremely uncommon

ghadi21:09:13

Java is f***ing fast

1
ghadi21:09:21

but niches do exist

phronmophobic21:09:56

Agreed, I've been using ffi (via JNA) to use c libraries. It works quite well.

ghadi21:09:57

see e.g. the work that @chris441 does with high perf numerics

phronmophobic21:09:31

I also use @chris441’s library, https://github.com/cnuernber/dtype-next/, which I highly recommend

ghadi21:09:41

Ruby and Python generally shovel coal into the C furnace because of performance limitations in Ruby and Python

😂 1
dpsutton21:09:58

that's a hysterical phrasing 😂

ghadi21:09:14

got it from Andy Wingo, I think

dpsutton21:09:23

well that's a good source lol

phronmophobic21:09:00

There are still plenty of good c libraries that don't have good java/clojure counterparts or the java wrappers actually make them more complicated than using them directly via ffi.

dgb2321:09:30

I mean JS in of itself is quite fast too (V8), good peak performance. But still, people tend to integrate with non-gc languages for substantial parts (node/deno) on the server side.

phronmophobic21:09:38

I thought that was to provide features that aren't built into v8's js standard library.

phronmophobic21:09:44

Not sure how much I would want to use ffi for performance reasons unless there is an existing library I'm interested in.

dgb2321:09:11

Right that is probably a much better reason

dgb2321:09:07

Right 🙂

dgb2321:09:53

well, there are native modules as well. and deno has some modules they wrote in Rust for perf reasons. But I guess those are very specific use-cases

phronmophobic22:09:58

Is there a source that says they wrote the modules in Rust for performance? Just curious.

dgb2322:09:21

I just skimmed through the source code a couple months ago, let me check.

dgb2322:09:45

It seemed sensible that it was perf reasons, I have no official/public statement to share.

phronmophobic22:09:54

Just looking at their docs: > All APIs that are not web standard are contained in the global Deno namespace. It has the APIs for reading from files, opening TCP sockets, serving HTTP, and executing subprocesses, etc.

phronmophobic22:09:29

Basically, the only cross platform APIs for those types of OS access are available in c/c++/rust type langs

phronmophobic22:09:52

even the JVM implements their standard library interfaces in c/c++

phronmophobic22:09:08

as far as I know

dgb2322:09:33

Yes, but I’ve come across stuff that was purely algorithmic so to speak

dgb2322:09:44

just kind of skimmed over it

phronmophobic22:09:28

Yea, I'm mostly just curious since, as you were saying, javascript's v8 usually has fairly good benchmarks

phronmophobic22:09:03

Did they ever end up re-implementing it in rust?

phronmophobic22:09:37

> it is on the roadmap to port it to Rust. (It is also the easiest way to get HTTP/2 and QUIC as well).

dgb2322:09:11

aside, the std library also has a couple of wasm (rust) modules: https://github.com/denoland/deno_std/search?l=rust

phronmophobic22:09:29

all those results look like they're all part of the same implementation for crypto digests

dgb2322:09:45

ffmpeg is a library that I find very attractive for example

phronmophobic22:09:31

same, there is an example using dtype-next with ffmpeg that I've been meaning to play with more, https://github.com/cnuernber/avclj

🙏 1