Fork me on GitHub
#off-topic
<
2020-06-28
>
ec08:06:20

In Java would you consider TransferQueue as poor mans channel for producer consumer scenario?

public TransferQueue<byte[]> subscribe(String topicName) {...}
like this, a good idea?

Alex Miller (Clojure team)11:06:42

The idea behind TransferQueue is very similar to async chans

jumar13:06:38

But TransferQueue has no buffer so it will just block unless there’s a free consumer available to do the work

Alex Miller (Clojure team)13:06:44

TransferQueue does have a buffer doesn't it?

Alex Miller (Clojure team)13:06:27

the transfer operation will have those semantics, but you can also put or offer without that

Alex Miller (Clojure team)13:06:54

(and SynchronousQueue is unbuffered like an unbuffered chan)

jumar17:06:07

Oh sorry, I confused TransferQueue with SynchronousQueue

noisesmith18:06:06

does anyone know of a text that approaches assembly in a clear and engaging way that would compare to SICP, or On Lisp or the K+R C book or Joy of Clojure or Elements of Clojure? I want to learn ARM assembly (for fun / art purposes and hey ARM is more and more relevant lately), but want to at least have a high quality book on it

lilactown19:06:56

I am eagerly hoping someone has a good reply because I would be very interested in that as well!

noisesmith19:06:39

maybe it's a book I'll need to attempt to write LOL, but surely someone has attempted it by now, probably one of the first gen of CS masters

Drew Verlee19:06:58

Ah. some light reading

seancorfield19:06:33

Every single assembly language is different so I don't know that there's enough "competition" to have anything more than a reference manual for a specific chipset?

seancorfield19:06:59

I really liked 6502 Programming (I think that's the title) from decades ago.

noisesmith19:06:35

right - but k+r informed how I write java and c++, I think assemblies have at least that much commonality

noisesmith19:06:58

or at least RISC ones...

noisesmith19:06:23

so you recommend it?

seancorfield19:06:58

I should pull it out and double check that I'm not just remembering it with rose-tinted glasses...

seancorfield19:06:10

OK, yeah. I paid ten pounds, 25 p for it in the early '80s. The price is hand-written on the inside front leaf, in pencil 🙂

seancorfield19:06:11

It starts off with the basics of binary and stuff, then looks at the hardware organization and chip instructions. It discusses addressing modes etc. Then it gets into actual application programming with assembly.

seancorfield19:06:34

What sort of level are you at with assembler/machine-level stuff right now @noisesmith?

noisesmith19:06:02

I understand things like calling conventions, registers, load, store, conditional branching, the basic add / overflow kind of stuff

noisesmith19:06:52

what I don't have is the ability to translate that into understanding a dumped procedure, or follow the code and see bugs clearly

noisesmith19:06:10

(that might translate to "beginner but not absolute beginner")

noisesmith19:06:41

a fun end goal would be to understand and improve the ARM instructions produced by JVM JIT

noisesmith19:06:09

(I've heard a rumor that there isn't a quality hotspot for ARM)

seancorfield20:06:05

@noisesmith sounds like you might do better with an ARM-specific book at this point. $40 is a lot to drop on an "antique" (but I still have great fondness for the 6502 processor 🙂 )

👍 3
noisesmith20:06:51

the biggest appeal I could see there is that game-boy has sound and video generation available, and you can write code for it using 6502 there are some "cool kids" who make dance music that way, and that could be fun

noisesmith20:06:17

but there are even more arm devices out there, with even better audio and graphics capability :D

seancorfield20:06:22

I haven't done any assembler stuff since the early '90s at this point. I did a lot of it before then. 6502, 68000, 8080, 8086, IBM 8100, some VM 370 stuff... SPARC, 88000 (Motorola, when it was still designated the 78000)...

seancorfield20:06:36

...I started with PRIME assembler at university (PRIME had four different assembler dialects)

chepprey21:06:46

The 6502 is a lovely thing. Few years ago I helped my friend implement a pacman clone on a Commodore vic-20. I do music, he needed the intro song code. I was given a "budget" of 80 bytes (yes, bytes) for the music data, and player code. I did it in 64 bytes. 🤓 Coding those machines is such a different world. Very fun.

Lennart Buit21:06:01

Oh, gameboy and NES are so fascinating to me, they are so terribly bad computers, but nintendo did manage to put sizeable games on them. I don’t know, I find it fascinating how the hardware dictates the games they could run, and if you kept within those boundaries, you could make fun games on a machine that could do almost nothing

Lennart Buit21:06:53

Things like, you can do screen scrolling left to right or top to bottom

Lennart Buit21:06:08

Except super mario bros 3, which does both, and is showing artifacts because of it

Lennart Buit21:06:12

The creativity in finding solutions for those kinds of problems, I don’t know, sometimes I wish I started programming in that time instead of like 10 years ago

Lennart Buit21:06:26

or megaman which had aritfacts because you could only have so many entities on a scanline

chepprey22:06:57

Have you ever read about what it takes to program the Atari 2600? Where you actually need to have precise cycle counts of your instructions to feed graphics to the raster beam on the fly. No memory mapped graphics. 🤯

Lennart Buit10:06:27

I haven’t, its funny that as a 90s kid, I am more interested in nintendo stuff than in atari stuff

Lennart Buit10:06:45

Grew up with GBC ^^

Lennart Buit21:06:50

well, by todays standards that is

Lennart Buit21:06:56

(if this fascinates you too, there is a nice explanation of the SNES: https://www.youtube.com/watch?v=57ibhDU2SAI )

👀 3