mrkite

joined 2 years ago
[–] mrkite@programming.dev 2 points 2 years ago

One of my oldest programming books is all about using machine language to program.

https://vintageapple.org/apple_ii/pdf/Apple_Machine_Language_1981_(raw-bw).pdf

At the time, even assemblers cost money. I remember saving up for Merlin which is an assembler for the Apple II.

[–] mrkite@programming.dev 15 points 2 years ago* (last edited 2 years ago) (3 children)

Started? Java has had a bad reputation since its inception. Slow startup, memory hungry, verbose. The main benefits of Java were its WORA mindset and its memory safety.

Rust takes that safety even further, plus it's making inroads in places Java would fall flat. For example, the M1 video drivers for Linux are written in Rust.

I personally can't wrap my mind around Rust's memory model.. Java is far easier to understand. That said, Rust certainly has momentum that I haven't seen since Java replaced Scheme in every university's CS101.

[–] mrkite@programming.dev 3 points 2 years ago

https://archive.org/details/BYTE-MAGAZINE-COMPLETE (although contrary to the name it's not complete, only goes to 89)

[–] mrkite@programming.dev 6 points 2 years ago

Just seeing the Byte logo makes me want to open up that magazine and see which basic listings I can type in.

[–] mrkite@programming.dev -5 points 2 years ago (1 children)

You still worked for the same company... programmers job trees aren't that deep. Either you got promoted out of programming or the promotion isn't worth mentioning.

[–] mrkite@programming.dev 5 points 2 years ago (2 children)

It got renamed due to trademark stuff just after the first one was released. It's called Quest for Glory now.

[–] mrkite@programming.dev 3 points 2 years ago

The IIgs version has the best music. Actual sampled instruments.

[–] mrkite@programming.dev 3 points 2 years ago

Hayes 2400 baud external modem with the red leds. Technically it was my dad's but I had procomm plus on a floppy and would sneak over and use it while he was at work.

[–] mrkite@programming.dev 5 points 2 years ago (3 children)

2 years seems insane to me. I wouldn't hire anyone who has a resume full of job hopping every other year.

[–] mrkite@programming.dev 6 points 2 years ago (5 children)

My favorite test for ChatGPT is to ask it to write a function to divide two numbers in 6502 assembly. Not only is there no DIV instruction to rely on, but the 6502 is very register starved, so you get a lot of screwups. Here's one example of what ChatGPT generated:

; Inputs:
; - A: dividend
; - X: divisor

DIVISION:
    LDX #0       ; initialize quotient to 0
    CPX #0       ; check for divide-by-zero error
    BEQ DIVIDE_BY_ZERO
    CLC          ; clear carry flag
DIV_LOOP:
    CMP X,A      ; compare divisor with dividend
    BCC DIV_DONE ; if divisor is greater, division is complete
    SEC          ; set carry flag
    ROL A        ; shift dividend left
    INX          ; increment quotient
    JMP DIV_LOOP ; continue division
DIV_DONE:
    RTS          ; return from subroutine
DIVIDE_BY_ZERO:
    ; handle divide-by-zero error here
    RTS

You can see it immediately overwrites the divisor with the quotient, so this thing will always give a divide by zero error. But even if it didn't do that, CMP X,A is an invalid instruction. But even if that wasn't invalid, multiplying the dividend by two (and adding one) is nonsense.

[–] mrkite@programming.dev 8 points 2 years ago (2 children)

Agreed. While I've never used ChatGPT on an actual project, I've tested it on theoretical problems and I've never seen it give an answer that didn't have a problem.

So I would treat it like any answer on Stack Overflow, use it as a start, but you should definitely customize it and fix any edge cases.

[–] mrkite@programming.dev 5 points 2 years ago (1 children)

I think this is a good idea, at the very least to teach how x11 works, since a lot of that gets buried in libraries. I just have two concerns.

One: I'm a little confused to why you decided to use the stack as temporary storage in the stdout pointer example as opposed to using a global .data segment. Using the stack for locals, the stack for function arguments, and basic pointers is a lot to cover all at once.

and two: you should really give a higher level overview of x11 first. Otherwise you're just randomly opening a socket and stuffing data into it without explaining why.

view more: ‹ prev next ›