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
ynohtna
Feb 16, 2007

backwoods compatible
Illegal Hen

Nomnom Cookie posted:

loop{} with a FIXME to think about doing something sane

a new universally applicable design pattern has been added to my toolkit

Adbot
ADBOT LOVES YOU

Visions of Valerie
Jun 18, 2023

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

Nomnom Cookie posted:

they made a github repo and it does not solve this at all. the panic handler you get from them is loop{} with a FIXME to think about doing something sane. it also only lets you target the most recent KMDF version and makes heavy use of bindgen inside build.rs. im not holding my breath waiting for a solution from MS on this or it being a solution i'd be willing to adopt

is this about how Linux does it too? Kernel halting because of a naughty driver seems like several backward steps

Nomnom Cookie
Aug 30, 2009



Visions of Valerie posted:

is this about how Linux does it too? Kernel halting because of a naughty driver seems like several backward steps

linux doesnt try to unwind kernel stacks for one thing lmao. the linux kernel version of you did a fucky wucky with a pointer is an oops and actually it might do stack unwinding? i'm not sure? but you definitely don't get catch blocks. or ofc linux can panic

there are good arguments in favor of exceptions here, like an invalid userspace access is a condition you abolutely must handle and if you don't there is no reasonable way for the system to recover. politely returning an error code from whatever API maps the userspace buffer is just begging for a dipshit to hold things wrong and make a giant hole for attackers to drive kernel code execution through. linux or windows, kernel space is a lets call it a high trust environment. if you are running code in ring 0 there is nothing stopping you from panicking the system whenever you feel like it, opening a socket to china and piping shellcode into ram, creating a whole rear end transaction manager (learning about windows CLFS caused my mind to deadlock for like 15 minutes straight). however you are not the first person to note that often driver developers are dipshits who don't deserve this level of trust therefore FUSE, UMDF, that thing vista did to stop the nvidia driver from constantly blue screening everyone, and so on

one variation of this take is we must never care if something crashes and then you have a microkernel. which sounds neat and all but in practice idk how useful it is to have a system that's technically still running but the root filesystem is in CrashLoopBackOff

Nomnom Cookie
Aug 30, 2009



i guess if youre an airplane it might be nice. this is why they put kubernetes in the f-16

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
uptime guarantee technically maintained

EIDE Van Hagar
Dec 8, 2000

Beep Boop

BobHoward posted:

don't do verilog

i beg

(i do verilog :smith:)

it’s SystemVerilog all day every day for me. and a little python scripting.

Nomnom Cookie
Aug 30, 2009



anyway kernel programming is really cool and fun. you get to be in an environment where crashing the entire system isn't the worst thing that can happen. in userspace implementing panic by just looping forever is dumb and stupid and lovely but worst case you kill -9 the process and move on. in kernel space doing that bullshit at the wrong time means like...for example now one of the cores is just dead. you put it in an infinite loop while servicing an interrupt and now that core just doesn't do anything anymore. and the rest of the kernel will interact with your code in good faith and keep sending you interrupts to service meaning more opportunities for you to headshot cores. i didn't rant about it earlier because it wasn't the point but that bullshit is what you see in literally baby's first embedded rust blog posts about how to do things completely wrong but you don't care because your deployment target is an arduino. if my boss forced me to write code that bad and then open source it i would be so embarrassed i would seriously consider changing jobs. absolutely awful

anyway isnt it neat how the platform is designed assuming certain semantics from the languages running on it and rust is almost kinda compatible with those assumptions. that's the kind of mismatch where you get to do fun and perverted things and possibly convince people it was a good idea

Visions of Valerie
Jun 18, 2023

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

Nomnom Cookie posted:

linux doesnt try to unwind kernel stacks for one thing lmao. the linux kernel version of you did a fucky wucky with a pointer is an oops and actually it might do stack unwinding? i'm not sure? but you definitely don't get catch blocks. or ofc linux can panic

Yeah I could have phrased my question better. I was curious how the new Rust in Linux stuff handles panic()ing - like, whether it ties it into the unwinder somehow

Nomnom Cookie
Aug 30, 2009



DELETE CASCADE posted:

uptime guarantee technically maintained

not that i've ever worked in aerospace but to my knowledge the sane people don't touch microkernels at all for airplanes, they instead think very hard about failure modes and put a lot of effort into ensuring they don't hit them while also minimizing blast radius. somehow turning the airplane computer into a complex system with dozens of concurrent processes interacting in unpredictable ways is not considered "good"? despite microkernels claiming to improve reliability? it feels like maybe dipshit computer people who get hard anytime they hear the prefix micro- are not qualified to talk about systems engineering things

Nomnom Cookie
Aug 30, 2009



Visions of Valerie posted:

Yeah I could have phrased my question better. I was curious how the new Rust in Linux stuff handles panic()ing - like, whether it ties it into the unwinder somehow

drat now im curious too. does linux even unwind on panic? i thought it dumped the call stack and dug itself a shallow grave. you're not supposed to come back from a panic

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
"torvalds was right tanenbaum was wrong" got in the textbooks 20 years ago. altho not in tanenbaum's textbook, lol

crazypenguin
Mar 9, 2005
nothing witty here, move along

Nomnom Cookie posted:

linux doesnt try to unwind kernel stacks for one thing lmao. the linux kernel version of you did a fucky wucky with a pointer is an oops and actually it might do stack unwinding? i'm not sure?

linux oops is basically the same as killing the current "process", even if that process is a kernel task.

dying in the kernel code, though, means that poo poo can get corrupted (unlike killing a userspace task) because the kernel might still be holding locks, in the middle of mutating state, etc

in general the way linux is suppose to handle errors is by properly checking for everything and returning error codes so the panics/oops never happen at all ever. as you can imagine for C code, this is a poo poo show generally

Visions of Valerie posted:

Yeah I could have phrased my question better. I was curious how the new Rust in Linux stuff handles panic()ing - like, whether it ties it into the unwinder somehow

iirc it's a kernel panic. i do not know the status of trying to change it at all.

most of the Rust for Linux concern with panics is over Rust API designs that allow for panics too easily, not what happens if a panic actually happens. I think they're shooting for the same C-like "panics should never happen actually" and working on more APIs that return results and whatnot (e.g. to handle allocation failure)

Visions of Valerie
Jun 18, 2023

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

crazypenguin posted:

iirc it's a kernel panic. i do not know the status of trying to change it at all.

most of the Rust for Linux concern with panics is over Rust API designs that allow for panics too easily, not what happens if a panic actually happens. I think they're shooting for the same C-like "panics should never happen actually" and working on more APIs that return results and whatnot (e.g. to handle allocation failure)

makes sense, thanks

Nomnom Cookie
Aug 30, 2009



what im shooting for in windows land is making rust-originated panics into bugchecks and supporting unwinding from kernel APIs into rust stacks plus "somehow" halting unwinding in a reasonable way that allows for recovering the current control flow. in other words visual R# now with catch blocks, but not real catch blocks because that would be so much work

Radia
Jul 14, 2021

And someday, together.. We'll shine.
but why

Cybernetic Vermin
Apr 18, 2005

handling errors is sometimes good. and indeed the kernel is one of those places where letting things just crash is not a good plan (unless we cycle back to tanenbaum being more correct)

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
supporting seh requires a lot of compiler work, since it makes a lot of things well-defined that you normally just kindof assume don’t happen. you’re probably going to spend a lot of time dealing with stuff in the rust frontend, and it’s probably going to perform like poo poo because rust really wants llvm to be aggressive and seh basically disables the optimizer

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
clang and llvm added support for seh a few years ago, but it is not engineered to try to be even halfway intelligent; it is just enough to make specific code patterns work goddamnit

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

bob dobbs is dead posted:

"torvalds was right tanenbaum was wrong" got in the textbooks 20 years ago. altho not in tanenbaum's textbook, lol

well yeah, because tanenbaum was right, why would he put something wrong in his book just because it was popular?

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?
port seL4 to rust

BobHoward
Feb 13, 2012

The only thing white people deserve is a bullet to their empty skull

EIDE Van Hagar posted:

it’s SystemVerilog all day every day for me. and a little python scripting.

yeah same actually. SV's a huge improvement over verilog 95, but i'd love for the industry to be built around a better language foundation than either vhdl or verilog

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

rewrite your CPU in Rust

redleader
Aug 18, 2005

Engage according to operational parameters

Nomnom Cookie posted:

CrashLoopBackOff

im begging infra people: please stop thinking about everything in terms of kubernetes

Sapozhnik
Jan 2, 2005

Nap Ghost

redleader posted:

im begging infra people: please stop thinking about everything in terms of kubernetes

code:
apiVersion: com.somethingawful.forums/v1
kind: Reply
metadata:
  generateName: reply
  namespace: yospos
data:
  spec:
    type: text/plain
    content: "no"

Nomnom Cookie
Aug 30, 2009



rjmccall posted:

supporting seh requires a lot of compiler work, since it makes a lot of things well-defined that you normally just kindof assume don’t happen. you’re probably going to spend a lot of time dealing with stuff in the rust frontend, and it’s probably going to perform like poo poo because rust really wants llvm to be aggressive and seh basically disables the optimizer

does it help that i dont care about supporting seh well and just want to make a spot on the call stack that will turn unwinding into a Result. im not above writing a little guy in c to hold the seh gubbins or something similar

Nomnom Cookie
Aug 30, 2009



Radia posted:

but why

because i enjoy making things exist which should not

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost

Nomnom Cookie posted:

because i enjoy making things that exist which should not

then just accept that your hubris has doomed you, also straightforward

Nomnom Cookie
Aug 30, 2009



bob dobbs is dead posted:

then just accept that your hubris has doomed you, also straightforward

if my life doesn't end with a soliloquy and several skulls i will be very disappointed

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
here lies nomnom, whose cookies were never fully baked

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Nomnom Cookie posted:

does it help that i dont care about supporting seh well and just want to make a spot on the call stack that will turn unwinding into a Result. im not above writing a little guy in c to hold the seh gubbins or something similar

the basic problem you’re going to face is the question of what the hell state all the rust functions are in if they throw because of some random memory access that rustc doesn’t recognize as a potential source of a panic

if you don’t need to handle exceptions originating within rust functions then it’s a whole lot easier because then rust sees it as originating from a call like any other panic. i don’t know if rust knows that c functions can panic but it can’t be that hard to teach it

echinopsis
Apr 13, 2004

by Fluffdaddy
rust is still a baby





dude at work is learning himself some python and he asked me my opinion on what he should learn next. idk why me? spose coz I sometimes talk about coding stuff with him and I have a few more clues but ya know i’m still a loving casual. anyway I told him perl js because I assume that’s a language that is handy to know seeing as it’s loving everywhere

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
js is definitely a handy language to know from a "getting stuff done" perspective, and it can be used in conjunction with server-side python to make webapps

likewise c is a handy language to know (at least the rudiments), and again it can easily go hand-in-hand with python

if he doesn't already know some flavor of sql, learning with posgres or sqlite makes sense

if he's interested in game modding, lua is a neat little lang

if he wants to learn a language that'll stretch his general understanding of programming, rather than be directly useful, any of scheme, ocaml, forth, prolog, erlang, rebol, or apl/j/k would surely expose him to new ideas

redleader
Aug 18, 2005

Engage according to operational parameters
yeah, a good question to ask him (and then the thread) is "what do you want to do with that knowledge?"

echinopsis
Apr 13, 2004

by Fluffdaddy

redleader posted:

yeah, a good question to ask him (and then the thread) is "what do you want to do with that knowledge?"

the answer would be “get out of pharmacy where I have to deal with humans”

Internet Janitor posted:

js is definitely a handy language to know from a "getting stuff done" perspective, and it can be used in conjunction with server-side python to make webapps

likewise c is a handy language to know (at least the rudiments), and again it can easily go hand-in-hand with python

if he doesn't already know some flavor of sql, learning with posgres or sqlite makes sense

if he's interested in game modding, lua is a neat little lang

if he wants to learn a language that'll stretch his general understanding of programming, rather than be directly useful, any of scheme, ocaml, forth, prolog, erlang, rebol, or apl/j/k would surely expose him to new ideas

this is interesting to me at the very least. I am on an amateur level familiar with python, c, js.. but never even looked at those other ones. I find coding interesting from a pure interest level, not just “get poo poo done” level, so that’s a good start


I’ve been suggested to learn react which I know is ultimately js/html but it’s to get some poo poo done. i’ll get my head round it. a concept with me making crimecommitter was pure js but when i’ve been reading about react seems like I can focus a bit more on the mechanics and less on it fundamentally displaying anything. but i’m just rambling now

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
a not-totally-crap estimate says that there's 15 million peeps who program js in the world, prolly something like 3-5 million frontend devs of whatever description

i would be surprised if all of the obscure langs ij mentions combined have 250k devs total (forth et al), doublecounting peeps who know more than one, and 50k paid devs. there's something like 5000 paid clojure devs in the entire world, which i mention cuz i used to be one of them

bob dobbs is dead fucked around with this message at 05:24 on Feb 16, 2024

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
if you want the intersection of "comes at programming from an unquestionably different point of view than normal peep langs" and "will unquestionably be useful for making money with if you make money with computer in any way", sql is your choice (but you would have to find a resource that's very serious about the first point, if you want to explore the first point - very few sql resources make the lang rise up and dance). prolog can be colorably presented to the uninitiated as "sql on fuckin steroids", too

bob dobbs is dead fucked around with this message at 05:23 on Feb 16, 2024

Internet Janitor
May 17, 2008

"That isn't the appropriate trash receptacle."
i'm shocked to hear there are only a couple thousand clojure jobs in the world; there's at least a similar order of magnitude of actively employed Q programmers, and clojure is a much more widely-known language. probably only a couple hundred K programming jobs, though, and i know people who work at (or have personally worked at) most of the companies that use it

a basic understanding of sql/relational algebra really is a fundamental skill for any programmer; applicable in a remarkable range of places. not unlike fluency with excel features like vlookups and pivot tables, sometimes just having a grasp of the fundamentals of sql can make you seem like a wizard to coworkers

i think playing with any apl-ish language is really helpful for the way it encourages thinking about manipulating data structures all at once, and building programs directly out of language primitives instead of building up abstractions. my current main project, lil, is an attempt at exploring a synthesis between apl-ish ideas and sql-ish ideas

bob dobbs is dead
Oct 8, 2017

I love peeps
Nap Ghost
i guess it's prolly an undercount if you include freelance choose-your-own-language dealios, but 1000 js devs to 1 clj dev sounds about right to me

echinopsis
Apr 13, 2004

by Fluffdaddy
keep going keep going I am almost there

Adbot
ADBOT LOVES YOU

Visions of Valerie
Jun 18, 2023

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

echinopsis posted:

keep going keep going I am almost there

you waiting for the jvm to start up echi?

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