New around here? Register your SA Forums Account here!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Share Bear
Apr 27, 2004

this one yeah? https://www.usenix.org/system/files/conference/atc17/atc17-o_callahan.pdf

Adbot
ADBOT LOVES YOU

Subjunctive
Sep 12, 2006

ask me about nix or tailscale

this one is better, IMO

https://arxiv.org/abs/1705.05937

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

yeah. i'll check out the extended version that subjunctive posted, though

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
I did it folks

I actually used The FOR-CASE paradigm in real code

Swift code:
    /// Get a sequence of words to form a raw Stack Frame Save Area package.
    func rawValues(for descriptor: UInt12) -> [UInt64] {
        let (Xs, At, Xt) = Self.unpack(descriptor: descriptor)
        let countX: Int = Int(Xt - Xs + 1)
        let countA: Int = Int((At > 2) ? (At + 1) : 3)
        let count = 1 + countA + countX
        var values: [UInt64] = Array(repeating: 0, count: count)

        values[0] = self.P

        for a in 0...Int(At + 1) {
            values[1 + a] = self.A[a]

            switch a {
            case 1: values[1 + a] = values[1 + a] | UInt64(self.VMID) << 56
            case 2: values[1 + a] = values[1 + a] | UInt64(descriptor) << 48
            case 3: values[1 + a] = values[1 + a] | UInt64(self.UM) << 48
            case 5: values[1 + a] = values[1 + a] | UInt64(self.UCR) << 48
            case 6: values[1 + a] = values[1 + a] | UInt64(self.MCR) << 48
            default: break // do nothing
            }
        }

        for x in Int(Xs)...Int(Xt) {
            values[1 + countA + (x - Int(Xs))] = self.X[x]
        }

        return values
    }
this is to construct a Stack Frame Save Area as used by the Cyber 180, a variant of which is the Central Processor in Control Data Corp’s Cyber 962 mainframe

the Cyber 180 is actually a really nice and clean 64-bit design overall, it’s incredible to me that nobody decided to make a single-chip (or even chipset) clone in the 1990s to run at hundreds of MHz

it’s a nice balance between the flexibility of CISC and the simplicity of RISC: it’s ultimately a load-store architecture, but it has reasonable addressing modes too; it was designed as 64-bit since its first release in the very early 1980s, since the systems it was intended to replace were 60-bit; it doesn’t have too much “weird mainframe stuff” in it, besides things like decimal arithmetic support a couple “edit” instructions; it had vector-processing extensions; and it has only four instruction formats and two instruction sizes that can be easily detected at decode time (the opcode is always in the same place, and the mapping from ranges of opcode values to instruction formats is trivial) so it’d be straightforward to pipeline

in certain ways it’s like if someone had seen a slideshow overview of the 68000 and then designed a 64-bit version based on their memory of that

oh yeah and unlike its predecessor the Cyber 170, it does have interrupts etc. even though it does still rely on a suite of 16-bit Peripheral Processors for I/O in general, so a small system could easily use such a CPU directly with peripherals without having to replicate those too

akadajet
Sep 14, 2003

that sounds like yield in c#

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

eschaton posted:

Control Data Corp’s Cyber 962 mainframe

now there's a name fit for a real computer

i would also like to point out that the lack of a "case 4" in that switch statement causes me significant mental suffering

eschaton posted:

oh yeah and unlike its predecessor the Cyber 170, it does have interrupts etc

kinda curious about this part though. was the previous design just a batch-mode machine? like it'd poll various devices at fixed intervals when it didn't have anything better to do?

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
the previous systems (Cyber 170 and earlier) were essentially batch systems that were extended for timesharing, as their architecture is descended from the original 60-bit Control Data systems of the early 1960s

essentially, the Central Processor(s) and Central Memory of those systems were fully under the control of the Peripheral Processors whose main jobs are to handle I/O, including things like suspending and resuming execution: in this design, a Peripheral Processor manages the job queues and interactive time slicing on behalf of the OS, rather than (say) a timer directly interrupting the Central Processor—they can just reach in and tell the Central Processor “save the current register set there and load new values from here” at in time (there’s a single instruction to do each, on both the Central Processor and the 16-bit Peripheral Processor instruction sets)

as a result, the Control Data architecture has been a preemptive heterogeneous multiprocessor system from the start, which is also why it was fairly straightforward to do SMP even way back when: if there’s more than one Central Processor, the Peripheral Processor(s) managing the job queues and timesharing can just assign different processors to them and increase throughput easily (since even when timesharing there’s not much coordination needed outside the OS data structures)

eschaton fucked around with this message at 20:53 on Jan 13, 2025

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
for anyone interested in the 64-bit Cyber architecture, which is an extension/modernization of the 60-bit architecture, the Cyber 180 Virtual State Hardware Reference Manual Volume 1 and Volume 2 have all the details you could want

the Cyber 170 is even more fully documented in online scans now, though more Cyber 180 documentation is being scanned soon

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
and in-depth details about the Cyber 170 architecture are in the Cyber 170 State Reference

ryanrs
Jul 12, 2011

VMS? I prefer

Only registered members can see post attachments!

ryanrs
Jul 12, 2011

(only tangentially related, but I saw that in the hardware store today and needed to post it somewhere)

well-read undead
Dec 13, 2022

i rate it 1/2 goatse, could be better

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

with extreme power you only need one hand

ryanrs
Jul 12, 2011

goatse is no match for this shockproof adhesive

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

eschaton posted:

for anyone interested in the 64-bit Cyber architecture, which is an extension/modernization of the 60-bit architecture, the Cyber 180 Virtual State Hardware Reference Manual Volume 1 and Volume 2 have all the details you could want

the Cyber 170 is even more fully documented in online scans now, though more Cyber 180 documentation is being scanned soon

why is it that when i'm presented with the options to either do something useful which might help me find work, or do something of absolutely no use to me like read manuals for ancient computers, my brain will inevitably choose the latter option?

Kazinsal
Dec 13, 2011

Deep Dish Fuckfest posted:

why is it that when i'm presented with the options to either do something useful which might help me find work, or do something of absolutely no use to me like read manuals for ancient computers, my brain will inevitably choose the latter option?

because ancient computer manuals are so good

sometimes I just read old DEC and IBM documentation to unwind

Kazinsal
Dec 13, 2011

gently caress no wonder I'm single

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
we used to be not just a society but a civilization

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.

Deep Dish Fuckfest posted:

why is it that when i'm presented with the options to either do something useful which might help me find work, or do something of absolutely no use to me like read manuals for ancient computers, my brain will inevitably choose the latter option?

https://github.com/eschaton/Cyberdeck if you want to check my work

I’m doing the conversion to C on a branch, of course

Its a Rolex
Jan 23, 2023

Hey, posting is posting. You emptyquote, I turn my monitor on; what's the difference?
do people actually like type annotations in Lua? any time i look at them i enter a fugue state and retain nothing. when i try to add them i feel my mind go blank on the syntax and the language server/snippets seem only marginally useful

Asleep Style
Oct 20, 2010

Its a Rolex posted:

do people actually like type annotations in Lua? any time i look at them i enter a fugue state and retain nothing. when i try to add them i feel my mind go blank on the syntax and the language server/snippets seem only marginally useful

they seems clunkier and less enforced than pythons type hints and none of the dumb lua projects I've done have felt like they would benefit from them

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
you need a serious Weenie with a capital W to tack on type annotations properly. python has 90% of the worlds weenies in the first place and most of the Weenies, typescript has the one Weenie and his minions at microsoft. lua is lacking

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal

eschaton posted:

https://github.com/eschaton/Cyberdeck if you want to check my work

I’m doing the conversion to C on a branch, of course

what? goddamnit NO! i don't need more stuff to distract me!

well, i guess it wouldn't hurt to add it to my "list of neat stuff to check out later which grows faster than i can remove items from it" list

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
oh yeah as far as my own programming crap goes, i'm getting back into python since i haven't used it in a while and i'm rusty as all hell, and it's also the only interpreted language i can tolerate and willingly use. so i figured i'd make myself something to automate ingesting data from my bank and brokerage into the postgres db i use to keep track of my finances (as sane people do). i thought it'd be simple enough, until i realized that the jumble of csv crap you can export varies between accounts and i'm gonna be spending most of my time writing code to find matching transaction entries and normalizing data from different sources and bespoke formats. oh well, i suppose it's as good a way as any to remember basic poo poo about a language

as a side note, it's also possible to export the data i want in a format defined by an actual standard. unfortunately, the financial institutions i use only support some ancient rear end version of it which exports to sgml which, it is my understanding, is basically satan

ryanrs
Jul 12, 2011

Lua has type annotations?

Share Bear
Apr 27, 2004

Deep Dish Fuckfest posted:

oh yeah as far as my own programming crap goes, i'm getting back into python since i haven't used it in a while and i'm rusty as all hell, and it's also the only interpreted language i can tolerate and willingly use. so i figured i'd make myself something to automate ingesting data from my bank and brokerage into the postgres db i use to keep track of my finances (as sane people do). i thought it'd be simple enough, until i realized that the jumble of csv crap you can export varies between accounts and i'm gonna be spending most of my time writing code to find matching transaction entries and normalizing data from different sources and bespoke formats. oh well, i suppose it's as good a way as any to remember basic poo poo about a language

as a side note, it's also possible to export the data i want in a format defined by an actual standard. unfortunately, the financial institutions i use only support some ancient rear end version of it which exports to sgml which, it is my understanding, is basically satan

yeah doing this professionally (glueing disparate systems into a single unit w python) a lot of stuff is normalization

learn you a regex or how parsers work for great good

Deep Dish Fuckfest
Sep 6, 2006

Advanced
Computer Touching


Toilet Rascal
yeah well what i'm learning so far is that my python is rustier than i thought and that i sure as gently caress wouldn't do this sort of stuff professionally

Plorkyeran
Mar 21, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

ryanrs posted:

Lua has type annotations?

no, but there's multiple competing standards for type annotations in comments which different tools support

ryanrs
Jul 12, 2011

oh yeah, it turns out my tools support type annotations after all:

ryanrs posted:

I wrote this one the other day to strip comments out of Lua code so it takes less space in flash.
code:
#!/usr/bin/env python3

import re
import sys

not_newlines = re.compile('[^\\n]+')

def only_newlines(m):
    if m.group(1):
        # a long comment
        return not_newlines.sub('', m.group()) or ' '
    if m.group(3):
        # a short comment
        return not_newlines.sub('', m.group())
    if m.group(4) or m.group(5):
        # whitespace at start/end of line
        return ''
    if m.group(6):
        # whitespace mid-line
        return ' '
    else:
        # it's a string literal
        return m.group()

lua_comments = re.compile(
    "'(?:\\\\.|[^'])*'" +
    '|"(?:\\\\.|[^"])*"' +
    '|[ \\t]*(--)?\\[(=*)\\[(?s:.)*?\\]\\2\\][ \\t]*' +
    '|[ \\t]*(--)(?:\\[=*)?(?:[^[=\\n].*)?$' +
    '|^([ \\t]+)' +
    '|([ \\t]+)$' +
    '|([ \\t]{2,})',
    re.MULTILINE)

def strip_lua_comments(lua_code):
    return lua_comments.sub(only_newlines, lua_code)

sys.stdout.write(
    strip_lua_comments(sys.stdin.read())
)


I learned everything I know about Lua from reading the Lua 5.4 Reference Manual, and very little else. So this is the first I've heard of 'em, ha ha.

They do look useful though, even if just for syntax highlighting and documentation.

ryanrs
Jul 12, 2011

Share Bear posted:

learn you a regex or how parsers work for great good

or great evil, apparently

Share Bear
Apr 27, 2004

ryanrs posted:

or great evil, apparently

regex is low on the “the intent of this is to cause harm” scale of technology. we can argue about how much unintentional harm it does cause

not severe as radiation, maybe as much as printers (any time period)

bob dobbs is dead
Oct 8, 2017

Peeps are idiots, Leslie.
Nap Ghost
cfgs, however, enable serious touchin and are therefore hierarchically worse

duTrieux.
Oct 9, 2003

Deep Dish Fuckfest posted:

oh yeah as far as my own programming crap goes, i'm getting back into python since i haven't used it in a while and i'm rusty as all hell, and it's also the only interpreted language i can tolerate and willingly use. so i figured i'd make myself something to automate ingesting data from my bank and brokerage into the postgres db i use to keep track of my finances (as sane people do). i thought it'd be simple enough, until i realized that the jumble of csv crap you can export varies between accounts and i'm gonna be spending most of my time writing code to find matching transaction entries and normalizing data from different sources and bespoke formats. oh well, i suppose it's as good a way as any to remember basic poo poo about a language

as a side note, it's also possible to export the data i want in a format defined by an actual standard. unfortunately, the financial institutions i use only support some ancient rear end version of it which exports to sgml which, it is my understanding, is basically satan

i've found the pandas library to be very good for working with and/or normalizing tables, abstracts away a lot of annoying bullshit. a bit overkill but what honest solution isn't

The Fool
Oct 16, 2003


tbh I'll load pandas even if the only thing I'm using it for is reading or writing a csv

duTrieux.
Oct 9, 2003

The Fool posted:

tbh I'll load pandas even if the only thing I'm using it for is reading or writing a csv

yeah, gently caress it. god is dead

CarForumPoster
Jun 26, 2013

Share Bear posted:

regex is low on the “the intent of this is to cause harm” scale of technology. we can argue about how much unintentional harm it does cause

not severe as radiation, maybe as much as printers (any time period)

what? radiation is perhaps the most beneficial singular thing on the planet

sun gives life if you mean like all em waves

if you mean human made ionizing nuclear radiation its given us cures for cancer, better health diagnostic tools, and a replacement for coal power plants. sure it MIGHT destroy us but the atom giveth and the atom taketh away

Visions of Valerie
Jun 18, 2023

Come this autumn, we'll be miles away...

CarForumPoster posted:

what? radiation is perhaps the most beneficial singular thing on the planet

sun gives life if you mean like all em waves

if you mean human made ionizing nuclear radiation its given us cures for cancer, better health diagnostic tools, and a replacement for coal power plants. sure it MIGHT destroy us but the atom giveth and the atom taketh away

:chloe:

Share Bear
Apr 27, 2004

CarForumPoster posted:

what? radiation is perhaps the most beneficial singular thing on the planet

sun gives life if you mean like all em waves

if you mean human made ionizing nuclear radiation its given us cures for cancer, better health diagnostic tools, and a replacement for coal power plants. sure it MIGHT destroy us but the atom giveth and the atom taketh away

while this is sarcasm:

there was a split between intentional harm and unintentional harm in my post

radiation being kinda high on both post ww ii

eschaton
Mar 7, 2007

the knowledge knower. a wisdom imparter. irritatingly self-assertive. odorous.
I’m making my Cyber 962 emulator multithreaded to try to match the hardware behavior

  • one or two Central Processor threads
  • one Central Memory thread
  • five to sixty Peripheral Processor threads
  • five to sixty I/O Channel (device) threads
  • two threads for the control interface and the worker that manages all the rest

too silly? maybe. but honestly it shouldn’t be too much to ask of modern hardware and should continue to make implementation straightforward

Adbot
ADBOT LOVES YOU

ryanrs
Jul 12, 2011

How's the intercommunication work? It would be bad if there was some shared state where all 125 threads wanted to poke at the same cache line.

e: or if any of the the cpus needed to run in lock-step, that would suuuuck

ryanrs fucked around with this message at 03:42 on Jan 16, 2025

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply