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
redleader
Aug 18, 2005

Engage according to operational parameters
lol at anyone unfortunate enough to work directly with hardware

Adbot
ADBOT LOVES YOU

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

eschaton posted:

:cheers:

SF Bay Goon Meet

no promises, I'll see the CA offices maybe once a year, and while they're in bay, they're not in SF. but a solid "maybe"

jit bull transpile posted:

you guys are idiots. hack bunny is in Italy and we should be organizing gooncon Roma asap

we have a C++ conference :v: https://www.italiancpp.org/

carry on then posted:

and now every goon in yospos will rush in to insist they too know prolog because in nerd land the worst thing in the world is to admit you lack some piece of knowledge that others posess

no but I wish I did because I know it can be used to solve those annoying logical puzzles, and sudokus, and because I want a thing that aggregates facts from multiple sources and detects inconsistencies (which is probably an abuse of prolog, idk)

also I bet you lack a piece of knowledge that I possess: there is a Prolog engine in window nt 4. it's used as a constraint solver to build the network configuration from a set of network interfaces, drivers, protocols, user settings etc. and since later windows versions retained the transactional ui (but disguised it as a regular property sheet dialog that curiously lacks an "apply" button), I can't help but wonder if it's still there in some form

microsoft's code analysis tool (prefast) was also originally written in prolog. again no idea if it still is

Suspicious Dish posted:

Pinging slurps mad rips or hackbunny or jmccall. Did they actually fix modules before ship?

https://twitter.com/jfbastien/status/1099420319847145473?s=21

sorry, was too busy salivating over the inspect statement :woop: and variadic foreach and coroutines, and being disappointed with the monadic operations for optional, and haven't started reading about modules yet

Slurps Mad Rips posted:

honestly people seemed more upset about contracts than modules. :v:

misread this as concepts at first but being upset at contracts doesn't make sense either

hackbunny fucked around with this message at 01:29 on Feb 26, 2019

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

DONT THREAD ON ME posted:

every programming language is type safe if you program on a kinesis advantage

strong typing is when you press the keys very hard

gonadic io
Feb 16, 2011

>>=

hackbunny posted:

strong typing is when you press the keys very hard

my office has astroturf, trust me you do a lot of static typing

nobody wants to be the one to touch the door handle to open it on the way out

akadajet
Sep 14, 2003

DONT THREAD ON ME posted:

every programming language is type safe if you program on a kinesis advantage

post of the day right here

Slurps Mad Rips
Jan 25, 2009

Bwaltow!

Suspicious Dish posted:

The reason I ask is because you wrote a very impassioned blog post about his modules wouldn't solve any of the problems that people thought they would. I assume some of those concerns no longer apply to the new proposal?

that post was about the Modules TS. what we ended up getting was a combination of the ATOM modules proposal and the TS with a few additions since San Diego. so merged modules are quite different. if you’re ok with reading legalese checkout the latest draft at https://wg21.link/N4800 (PDF link) and read up on some modules wording for a better idea on what it’ll entail.

VikingofRock
Aug 24, 2008




gonadic io posted:

I tried [bool; u32] and that did not work lol, std::mem::size_of::<[bool; 32]>() gives 32 bytes (thanks llvm)

C++ tried making a 32-element vector<bool> into an 8-byte object, and it is widely considered to be one of the biggest mistakes in the standard. The root of the problem is that you cannot take the address of an individual bit, so you can't have references to the array elements. The lesson Rust rightfully took from this is that [bool; 32] should be 32 bytes, just like [char; 32] is 128 bytes. Instead of special-casing these array types, it makes more sense to have separate space-efficient bitset and &str types with more appropriate APIs.

Plorkyeran
Mar 22, 2007

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

gonadic io posted:

my office has astroturf, trust me you do a lot of static typing

nobody wants to be the one to touch the door handle to open it on the way out

um what

what would make someone decide to install astroturf in an office

gonadic io
Feb 16, 2011

>>=

Plorkyeran posted:

um what

what would make someone decide to install astroturf in an office

It also has a table tennis table, bouncy hoppers, and a hammock. loving startups. At least those things don't actively impede work like the static from the astroturf does. I wonder if the failure rate of laptops is noticibly higher here due to it

JawnV6
Jul 4, 2004

So hot ...

VikingofRock posted:

The root of the problem is that you cannot take the address of an individual bit, so you can't have references to the array elements

with every other place that C++ seems content to take a comparison and turn it into a callsite, i don't get why this would be a sticky situation? you can't have a uintptr_t as a backing store or w/e, but you can take a fat reference around and still have something usable

VikingofRock
Aug 24, 2008




JawnV6 posted:

with every other place that C++ seems content to take a comparison and turn it into a callsite, i don't get why this would be a sticky situation? you can't have a uintptr_t as a backing store or w/e, but you can take a fat reference around and still have something usable

Yeah, I think what they should have done is make a separate bitvector class, with a fat reference returned by indexing. This well-known blog post basically makes the same argument, but unfortunately that's not what the standards committee did and now we are stuck with it unless they decide to break backwards compatibility.

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

VikingofRock posted:

C++ tried making a 32-element vector<bool> into an 8-byte object, and it is widely considered to be one of the biggest mistakes in the standard. The root of the problem is that you cannot take the address of an individual bit, so you can't have references to the array elements. The lesson Rust rightfully took from this is that [bool; 32] should be 32 bytes, just like [char; 32] is 128 bytes. Instead of special-casing these array types, it makes more sense to have separate space-efficient bitset and &str types with more appropriate APIs.

some people at work got burned hard by this recently. they were writing to the elements in a vector<bool> on different threads. this is fine on every other type of vector (as long as different threads access different elements), but because the c++ spec special cases vector<bool> this way, writing requires reading, flipping the bit, and then writing again, which isn't thread safe (the spec goes out of it's way to specify that vector<bool> isn't thread safe like the other vectors), causing non-deterministic behavior. i was the office hero for a week when i overheard them talking about it and after some questions found out that this was the root cause.

crazypenguin
Mar 9, 2005
nothing witty here, move along
this is one of those things that got done because someone thought it would be cute, and of course it turns out to be a disaster

Soricidus
Oct 21, 2010
freedom-hating statist shill

crazypenguin posted:

this is one of those things that got done because someone thought it would be cute, and of course it turns out to be a disaster

so ... programming?

Plorkyeran
Mar 22, 2007

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

JawnV6 posted:

with every other place that C++ seems content to take a comparison and turn it into a callsite, i don't get why this would be a sticky situation? you can't have a uintptr_t as a backing store or w/e, but you can take a fat reference around and still have something usable

vector<bool> does return a reference wrapper type that behaves like a normal reference 90% of the time. the problem is just that other 10% of the time where it behaves differently from any other vector<T>.

vector<bool> would be a pretty good data structure if it was named bitvector

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

HappyHippo posted:

some people at work got burned hard by this recently. they were writing to the elements in a vector<bool> on different threads. this is fine on every other type of vector (as long as different threads access different elements), but because the c++ spec special cases vector<bool> this way, writing requires reading, flipping the bit, and then writing again, which isn't thread safe (the spec goes out of it's way to specify that vector<bool> isn't thread safe like the other vectors), causing non-deterministic behavior. i was the office hero for a week when i overheard them talking about it and after some questions found out that this was the root cause.

this is probably not a good idea anyway because of cache contention

JawnV6
Jul 4, 2004

So hot ...
that reminds me, is there a type system that can express "one consumer on this bus is really lovely and can't make guarantees about false sharing for an entire cache line. oh, and the next one too lol almost forgot"

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?

rjmccall posted:

this is probably not a good idea anyway because of cache contention

I'm not super clear on the thing that they work on, but I believe it's a situation where there's a long calculation to produce a few values that are then written to the respective arrays.

gonadic io
Feb 16, 2011

>>=

JawnV6 posted:

that reminds me, is there a type system that can express "one consumer on this bus is really lovely and can't make guarantees about false sharing for an entire cache line. oh, and the next one too lol almost forgot"

I would love the ability to reason about caches in a programming language. it's so loving mysterious and magical.

JawnV6
Jul 4, 2004

So hot ...

gonadic io posted:

I would love the ability to reason about caches in a programming language. it's so loving mysterious and magical.
write a DMA driver

lots of reasoning about caches and invalidation more or less required, boatloads of fun

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

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

HappyHippo posted:

I'm not super clear on the thing that they work on, but I believe it's a situation where there's a long calculation to produce a few values that are then written to the respective arrays.

okay, that’s basically the situation where it might be fine

gonadic io
Feb 16, 2011

>>=

gonadic io posted:

I would love the ability to reason about caches in a programming language. it's so loving mysterious and magical.

i have a similar problem with laziness in haskell: it's entirely invisible at compile-time, has the possibility to gently caress things up at runtime, and promotes cargo culting and random guesswork because even when you know what you're looking for it's not always obvious if it has the behaviour you want or not.

it was why this paper which makes a unit test framework for specifying the laziness properties of your functions was so interesting: http://very.science/pdf/StrictCheck.pdf

not that i really write any haskell any more, when i can just use similar langs that don't have this entire class of runtime gotchas. say what you want about lifetimes but at least they make it very clear at compile time if you hosed them up

taqueso
Mar 8, 2004


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

:pirate::hf::tinfoil:

It would be really cool if you could specify cache constraints for pieces of code in <programming language> and get warnings or errors when certain sizes are exceeded.

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

taqueso posted:

It would be really cool if you could specify cache constraints for pieces of code in <programming language> and get warnings or errors when certain sizes are exceeded.

well, except that cache sizes vary with same-isa systems, drastically

echinopsis
Apr 13, 2004

by Fluffdaddy
none of this makes any sense to me

but please, carry on

Qtotonibudinibudet
Nov 7, 2011



Omich poluyobok, skazhi ty narkoman? ya prosto tozhe gde to tam zhivu, mogli by vmeste uyobyvat' narkotiki

Blinkz0rz posted:

does rust have a usable http server yet?

the linkerd2 proxy is written in rust, and while not a server, is still a major http implementation

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

JawnV6 posted:

that reminds me, is there a type system that can express "one consumer on this bus is really lovely and can't make guarantees about false sharing for an entire cache line. oh, and the next one too lol almost forgot"

why are you so obsessed with the idea that type systems are bad if they don't account for some arbitrary hardware behavior that you thought about 2 minutes ago

JawnV6
Jul 4, 2004

So hot ...

Phobeste posted:

well, except that cache sizes vary with same-isa systems, drastically
arm has CLIDR and friends, x86 you could bodge together a monstrous LUT from ARK if you have to. didn't say they had to be compile-time warnings or errors

Lutha Mahtin posted:

why are you so obsessed with the idea that type systems are bad if they don't account for some arbitrary hardware behavior that you thought about 2 minutes ago
"thought about 2 minutes ago," vs "wasted years debugging actual hardware with this exact behavior" who can tell??

functional folks take the idea that "C is Bad" and run with it, assuring me that type systems obviate whole classes of bugs that they're certain fill up C programmer's days. im describing actual honest to god hardware that i've used C to interact with as examples of constraints that I sure would like some help with!

im typing this post on a two-cache-line system irl right now, these are not fictional examples

Lutha Mahtin
Oct 10, 2010

Your brokebrain sin is absolved...go and shitpost no more!

i get that you know how hardware works but it's kind of tiresome itt to see someone post about a lang and then "oh but does your type system account for this :smug:"

echinopsis
Apr 13, 2004

by Fluffdaddy
will your type system consider “8008135” as a number or the string “boobies”

crazypenguin
Mar 9, 2005
nothing witty here, move along
probably no ordinary programming language is ever going to have a type system for dealing with weird hardware quirks ever. The closest is maybe static analysis tools.

Now, the hardware poking bits could absolutely be done better. I think it was BlueSpec demonstrated the ability to write a big pile of code that did a thing, then draw a line down the middle to say "this part gets synthesized into hardware" and "this part gets generated as a driver for that hardware."

of course, I think that was mostly an academic demonstration, not something they thought was ready for prime time. Plus, programming languages people and hardware design people have a long and bitter history of hating each other and calling each other stupid morons, so there's essentially no progress on this front ever. But I think that demonstration is evidence that improvements in driver writing pain-points will probably come from improvements in hardware description languages, not regular programming languages for writing software.

assuming hardware description languages ever improve, ever

Vomik
Jul 29, 2003

This post is dedicated to the brave Mujahideen fighters of Afghanistan

JawnV6 posted:

arm has CLIDR and friends, x86 you could bodge together a monstrous LUT from ARK if you have to. didn't say they had to be compile-time warnings or errors

"thought about 2 minutes ago," vs "wasted years debugging actual hardware with this exact behavior" who can tell??

functional folks take the idea that "C is Bad" and run with it, assuring me that type systems obviate whole classes of bugs that they're certain fill up C programmer's days. im describing actual honest to god hardware that i've used C to interact with as examples of constraints that I sure would like some help with!

im typing this post on a two-cache-line system irl right now, these are not fictional examples

have you considered trying out monads, op?

echinopsis
Apr 13, 2004

by Fluffdaddy
or sucking on these gonads

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
the price for being a hardware weenie is awful langs like c and vhdl

are the problems horrible? yes. could pl folks potentially contribute better solutions? yes. shall the twain ever meet? NEIN

pseudorandom name
May 6, 2007

what if there were a language that let you do gross C things, but had nice modern features that let you build something non-terrible on top?

DELETE CASCADE
Oct 25, 2017

i haven't washed my penis since i jerked it to a phtotograph of george w. bush in 2003
most modern langs are already like that: you can do the gross C stuff in an unsafe block, then build your nice modern poo poo on top of it. but then the modern lang isn't helping you with the gross C stuff, which is where many of the problems arise, so if you're doing primarily gross C stuff then why bother? hence people still program in C

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?

Phobeste posted:

well, except that cache sizes vary with same-isa systems, drastically

but imagine your environment knew your targets sufficiently that when a new one with different behavior was added, you got a warning and could code for that too, selecting at runtime what to use

running old code on a new implementation of an architecture might be suboptimal, but could also generate a warning or something so you know and could address in a subsequent release too

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?

Lutha Mahtin posted:

i get that you know how hardware works but it's kind of tiresome itt to see someone post about a lang and then "oh but does your type system account for this :smug:"

of course whenever people chime in with “the best way to do anything in any problem domain is via a sufficiently strong and parameterized type system,” …

eschaton fucked around with this message at 09:40 on Feb 27, 2019

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill
my new academic fp lang will make working with hardware trivial

first, consider a spherical cpu in a vacuum;

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