Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

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
Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Rufo posted:

insist on using your mac laptop but dont bring that converter thing they need to work with vga projectors, erupt in a fit of righteous indignation as you delay everyone
This but seriously. It's 2012 why am I sullying my Keynote slide deck with VGA adaptors

Adbot
ADBOT LOVES YOU

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

It's in principle really nice to have for a very small set of problems but you only have to deal with one instance of some :spergin: going so overboard with them that tbh in my age I kinda appreciate the hate for them. I mean if you're writing a C++ linear algebra library or a smart pointer class it might make sense to overload operator* for matrix multiplication or dereferencing, but anything more than that and your code starts to resemble Perl 6.

before anybody defends it too hard just remember even smart people use them badly. Why do iostreams overload the shift operators for io operations, whyyyyy

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

prefect posted:

I would have said Vim until I was introduced to Sublime Text 2. It's pretty sweet.
Sublime Text 2 with the SublimeClang plugin for C development is literally the best environment I've ever used

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

JawnV6 posted:

the first PE i worked with put sleep() in an ISR

JawnV6 posted:

he called it 'debouncing'

ok I'm so mad but this fuckin owns actually :chome:

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

mekkanare posted:

Could somebody recommend some reading on how asynchronicity is achieved by programming languages? I can't imagine a way for a caller to receive a signal from the callee other than using polling or hardware interrupts.

It might be a bit of a tough read if you're not a :pseudo: functional programmer :pseudo: but if you don't mind picking up a bit of SML syntax then Concurrent Programming in ML is a fantastic read imho

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Krankenstyle posted:

is this ever a reasonable thing to do?

real world examples only please
Here's an example of an untagged union that is reasonably common (at least in C in the embedded/low level OS world; I'm told it's technically undefined behaviour in C++).

Imagine I have a 32-bit value whose individual bytes also have semantic meaning. So, sometimes I want to treat the value as an entire int, or as four bytes. I could just treat the whole thing as a uint32_t and bit-mask into each byte whenever I need it, or I could use an untagged union.

code:
union {
  uint32_t all;
  struct {
    uint8_t b0;
    uint8_t b1;
    uint8_t b2;
    uint8_t b3;
  } bytes;
} u4_t;
(you could imagine, say, if individual bytes had particular meanings, like "header", you could replace the generic b0/b1/b2/b3 names; that was just for example's sake.
edit: and, of course, the fields in that struct can vary in size, even non-standard datatype sizes.)

it's ok that these are untagged because (at least in C99+, which guarantees that type punning works like this) you're not interested in "is this value of type X or type Y", but rather it is both type X and Y overlaid atop each other and hence, per gonadic io's comment, you treat it as an X or a Y depending on what the code at that moment finds most useful.

Dijkstracula fucked around with this message at 17:54 on Feb 22, 2019

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

also if people are interested in learning more about tagged unions, Yaron Minsky gave a really nice talk awhile back that shows the value of decomposing what's essentially a struct with nullable fields into a sum type

https://www.youtube.com/watch?v=DM2hEBwEWPc&t=1138s

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Zlodo posted:

it probably works the same way in c++ as in c but it's undefined because it'll work differently depending on the endianness, so it's not portable
No, it's undefined behaviour in C++ because the standard doesn't guarantee that the branches of a union will overlap in memory, whereas in C(99 and onwards) it does

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

In that case, they similarly addressed it in the C++ spec since I last checked.

From the C++11 spec:

quote:

9.5 Unions [class.union]

In a union, at most one of the non-static data members can be active at any time, that is, the value of at most one of the non-static data members can be stored in a union at any time.

edit: but, type punning is listed as UB in the C++ core guidelines, which were updated this year, and even includes a "Unfortunately, unions are commonly used for type punning. We don’t consider “sometimes, it works as expected” a strong argument." remark, so idk, just use C as the good lord intended sheesh yall

maybe it's the case that it'd UB for reasons other than memory overlap but I'm having trouble imagining what that would be :shrug:

Dijkstracula fucked around with this message at 18:36 on Feb 22, 2019

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Zlodo posted:

endianness
in the example above CPUs using different byte orderings are going to show a different correspondance between the bits as viewed as a 32 bit int and as 4 separate bytes

there are other things, like floats not necessarily being encoded using the IEEE 754 standard as c++ doesn't specify it, so type puning a float into one or more ints can give different results depending on the platform
So I'm now trying to find a confirmation that this is indeed not UB in C; if what you're saying is right then it would have to be UB both in C and C++ (as hackbunny seems to confirm).

I uh may have to go retract some PRs :v:

quote:

If the member used to read the contents of a union object is not the same as the member last used to store a value in the object, the appropriate part of the object representation of the value is reinterpreted as an object representation in the new type as described in 6.2.6 (a process sometimes called ‘‘type punning’’). This might be a trap representation.
My reading of this of this hinged on a sufficiently-advanced "reinterpretation" :(

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

bob dobbs is dead posted:

with this and the windows internals bits i nominate hackbunny for "shittiest time had touchin computers for a livin" award

if you're ever in the bay area peninsula i'll buy you a beer
would cross into san mateo county to do the same

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

In case you're interested there's a bunch of work done in the distributed systems space, though it has more to do with abstractions around failure modes than "typechecking" aspects of your system

https://www.youtube.com/watch?v=eAcDWcaezXY

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

JawnV6 posted:

i genuinely don't recall the animosity between hw folks and pl folks, that would require them to have some basic awareness of each other. the closest brush they had in my time was a feature that got killed, was supposed to provide fine-grained branch records or something to guide JIT engines.
where's my hardware read barrier :argh:

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Notorious b.s.d. posted:

didn't azul systems do this in their proprietary chips
they did; iirc shanendoah et al fake it by having an additional layer of indirection, kind of like how satb write barriers work, but of course reads happen way more often than writes so I suspect it's not great for perf :/

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

lmao if your most fundamental datatype wasn't designed immediately after reading the first 10 pages of the Okasaki data structures book

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

gonadic io posted:

i have this on my shelf. never done more than skim it ofc
same and also same

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

JawnV6 posted:

"oh my gosh, latency matters??" - every microkernel ever

At least as far as academic microkernels go, this is probably why synchronous IPC benchmarks (measured in clock cycles OF COURSE) are the single differentiating factor

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Sapozhnik posted:

imagine if this was the only system call interface that existed and you wouldn't be too far off
really this is just taking ioctl to its logical and purest conclusion

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

with the caveat that I am extremely dumb and barely know what I'm talking about on a good day,

quote:

effectively you either cannot issue any vector instructions out-of-order or you cannot issue the mode-changing instruction out-of-order

Do workloads modify `lmul` often enough in the middle of a computation such that the latter (where `lmul` acts as a fence/barrier/whatever) would affect instruction scheduling, practically speaking? I was imagining that you'd set your "multiple vector" factor in advance of some, like, convolution or stencil or whatever operation you want to go fast, and your data is laid out in a regular enough structure that that's ok

also hi Subjunctive long time no see :)

Dijkstracula fucked around with this message at 03:04 on Nov 10, 2022

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

I know a guy who replaced his build system with a Zig program and seems really happy with that - kind of interesting to imagine it as a replacement for glue code but I'm guessing that's not really the intended point in the design space

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Very far from a Rust fanboy here, but, if you haven't toyed around with Rust in the last few years it might be time to give it another go: a lot of the "argh borrow checker" complaints of pre-2015 Rust have evaporated by Rust folks making the checker smarter in complicated scenarios, especially around non-lexical lifetimes.

like if you really hate the notion of the compiler yelling at you about this stuff and yet don't want to go back to the days of dereferencing a god-knows-what pointer into infinity there are plenty of GCed languages out there that hit the mark there

(can't speak to the syntax complaints since that's a subjective thing, and objectively every language has bad syntax except for ML)

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Athas posted:

The syntax is easily the worst part about ML. 90% of Haskell's attraction is the nicer syntax.

indentation-aware syntax automatically makes haskell a plang sorry :colbert:

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Sapozhnik posted:

A borrow checker cannot save your concurrent algorithm from an algorithm-level deadlock.
this isn't really true, one of the things rust enjoyers love to harp on is the fact that one of the borrow checker guarantees is data race freedom

(e: totally possible that I'm missing your point by "algorithm-level deadlock", so retracting the above :shobon: )

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

There are plenty of GC algorithms optimised for low latency workloads, so "we need to minimise variance in our performance" isn't a reason not to take advantage of one

leper khan posted:

GC langs are fine on the service side. Your goal for real time comms is to be IO bound, and if you can keep that up the rest of it doesn't matter beyond cost optimizations. For non real time, just use your favorite rest/webapp framework and be done with it.
this is correct, if HFT firms can use Java and OCaml, so too can your favourite FPS's deathmatch match ranking service

Zlodo posted:

There's a reason unreal engine moved away from unreal script.
I'm not a game developer at all but UE4 still has a GC so whatever reason that was, I don't think that was it?

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

in other news, you might ask what over-the-hill plang enjoyers are up to

because lol at dhh once again not understanding why type systems are good https://world.hey.com/dhh/turbo-8-is-dropping-typescript-70165c01

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

rotor posted:

types schmypes

dhh's alt spotted

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

getting so mad at all of u

Shaggar posted:

types are cool and good

except for shaggar, shaggar was right

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

tef posted:

also i do want to mention the paper "threesomes: with and without blame" because you need to understand that type theorists are not serious people

without looking it up I knew this was gonna be some phil wadler horseshit

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

abraham linksys posted:

if reading papers is so important maybe they shouldnt all be formatted as two column pdfs that are annoying as gently caress to read on a computer or phone
:eng101: PLDI papers are single-column

abraham linksys posted:

also they should be written in language me, a college dropout, can understand. none of these drat weird symbols either. dont know how im supposed to just remember what poo poo the half-life logo means in computers
honestly this is a problem even for us programming language PhD-doers: the phrase "how's Figure 2" is shorthand for "how much inscrutable nonsense in symbol form am I going to have to parse", saying nothing of everyone else who hasn't had training or experience in even the simple things like reading typing rules, etc :(

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

abraham linksys posted:

also they should be written in language me, a college dropout, can understand. none of these drat weird symbols either. dont know how im supposed to just remember what poo poo the half-life logo means in computers
Thinking about this a bit more: there have been a few talks at places like Papers We Love Conf that do a good job of explaining the basics of reading PL papers: Ron Garcia's keynote is an especially good, broad survey of "what even are all these greek symbols"

https://www.youtube.com/watch?v=jVyz3lWH2bA

It focuses primary on how to read papers with type theory in it because Ron's a type guy - I could have sworn I'd come across a broader one but damned if I can find it now. Nonetheless it's still a good talk imho

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Sweeper posted:

I’d love to read some papers, but I can’t even find papers for subjects I’m dealing with that aren’t 30 years old. no idea how to find papers. none.

sites like google scholar can help you find what subsequent papers cite those 30 year old ones

also research is cyclical and a lot of stuff that was hot 30 years ago isn’t an area of research anymore (“multimedia technologies” were second only to p2p networking protocols in the 90s and ain’t nobody touching that stuff today) so if you aren’t finding recent work there might be a reason

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Buck Turgidson posted:

They should publish papers in HTML

there's a push for this which looks great but who knows how it'll take

the cool thing about nota is that you can build in hyperlinks and click-to-learn-more stuff which is great for the aforementioned inscrutable greek symbols in a PL paper problem

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Soricidus posted:

why do they bother with the symbolic mess when they clearly know how to achieve the same effect using their words?

because at heart these are still math papers

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

tef posted:

"we learned it from watching you" huh

CMPSCI~1.TEX

but also as cybernetic vermin says sometimes you actually do want to be precise in your language, either because what you're describing warrants the precision or you're trying to baffle with bullshit

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

only if you forget to not check that the aio_write that you fired off completes, op

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

do you mean “what should i do if it’s time for pthread_exit() but I still have outstanding operations to complete”? you’re still free to block on pending events’s state changes, epoll-style, in a case like that I suppose

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

Subjunctive posted:

_exit() and let Ritchie clean it up

I mean those iops probably weren't worth completing anyway

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

tef posted:

how to find a loop in a linked list: free each item in turn, and if there's a segfault, there's a loop

this reminds me of an old job where they were touting a formally-verified memory allocator, but in order to make the automated proof go through free() had to be a no-op

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

my assumption is that java's new green threads are being pushed exclusively by low-latency hedge funds with deep pockets to drive JEPs, which is not inherently a bad thing but does mean that it might not be a general solution for everyone

oh nice, I wondered what gary bernhardt was up to these days

Adbot
ADBOT LOVES YOU

Dijkstracula
Mar 18, 2003

You can't spell 'vector field' without me, Professor!

rotor posted:

gentle request to take specific stuff like "help me with my game" to its own thread plz & thank

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