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
Cybernetic Vermin
Apr 18, 2005

ucs-2 supremacy

Adbot
ADBOT LOVES YOU

Sapozhnik
Jan 2, 2005

Nap Ghost
Well, that one's entirely on the Unicode consortium

Unicode consortium in the late 80s/early 90s: "It is absolutely possible to assign a code for every single glyph from every single human writing system in common use to a point in a 16-bit code point space. We are linguists, so you should trust us because we are experts in this field"

NT and Java development teams: "OK! Well, we're programmers and not linguists, so let's trust the experts. From this day forth, characters from every realm of this earth shall be encoded as 16-bit quantities. This data type shall be used throughout our new systems, which will be universal and legacy-free!"

Unicode consortium a few years later: haha j/k :xd:

NT and Java development teams: :suicide:

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
also Qt

tef
May 30, 2004

-> some l-system crap ->

Symbolic Butt posted:

ruby itself is not that bad imo but holy poo poo rails

rails loves returning nils everywhere

missing instance var: nil

missing array element: nil

missing hash element: nil

yep let's blame rails here

tef
May 30, 2004

-> some l-system crap ->

FamDav posted:

I'm going to call out into the void for a tef/monococqc paper dump

what's the good stuff in terms of formal verification/specification languages?

TLA+ book is online :shrug:

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

tef posted:

missing array element: nil

missing hash element: nil

eh at least people seem to use the fetch method instead

tef posted:

missing instance var: nil

ok this one is specially bad because people treat it as a feature and make it part of bespoke ruby idioms :stare:

tef posted:

yep let's blame rails here

sure, it's ruby's fault for starting the habit but rails went crazy beyond imo. old rails has the hardest ORM system to debug because of this poo poo

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
also ruby is very bad

triple sulk
Sep 17, 2014



CRIP EATIN BREAD posted:

also ruby is very bad

Shaggar
Apr 26, 2006
thankfully ruby is dead as hell

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

CRIP EATIN BREAD posted:

also ruby is very bad

Max Facetime
Apr 18, 2009

CPColin posted:

It's 8 bits, so -128 to 127. I'm guessing they went, "Well all our other primitives are signed, so it'd be weird if byte were unsigned." The only difference would have been that widening conversions wouldn't do sign extension, right? I think we would have all gotten over it. Maybe if they'd added a special operator that does the "& 0xff" for you, it wouldn't have been such a big deal.

it's a bit of a gotcha. apart from actual byte arrays the jvm and the underlying hardware operate in terms of ints anyways. so there's no reason to write "byte" rather than "int" ever pretty much

triple sulk
Sep 17, 2014



Shaggar posted:

thankfully ruby is dead as hell

it's the new legacy java except a thousand times shittier

weird
Jun 4, 2012

by zen death robot

James Gosling posted:

Quiz any C developer about unsigned, and pretty soon you discover that almost no C developers actually understand what goes on with unsigned, what unsigned arithmetic is. Things like that made C complex. The language part of Java is, I think, pretty simple.

Bloody
Mar 3, 2013

Max Facetime posted:

it's a bit of a gotcha. apart from actual byte arrays the jvm and the underlying hardware operate in terms of ints anyways. so there's no reason to write "byte" rather than "int" ever pretty much

assuming you never do anything involving actual bytes anywhere, sure

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i spent all my professional time with C processing byte streams and packing/organizing data in a custom file format.

i cant imagine there's any C dev that doesnt know whats going on with unsigned values.

Sapozhnik
Jan 2, 2005

Nap Ghost

lol

Sapozhnik
Jan 2, 2005

Nap Ghost
i want to copy an 8-bit integer to a 32-bit int in order to operate on it

byte b;
int x = b & 0x000000FF;

such elegance

also don't forget to use logical shift >>> everywhere instead of arithmetic shift >>

because right shifting with sign extension is a thing that people want to do ever

Thankfully at least there's Byte.toUnsignedInt() in Java 8 but yeah this poo poo is inexcusable. Like I'd actually prefer to have some sort of "make byte behave in a non idiotic way" pragma at the top of every translation unit from now until forever more over this poo poo show.

Max Facetime
Apr 18, 2009

Bloody posted:

assuming you never do anything involving actual bytes anywhere, sure

even then.

ByteArrayOutputStream takes single bytes as ints and gives out a byte array.
ByteArrayInputStream takes a byte array and gives out single bytes in ints.

and that's all you need for arrays of bytes

Shaggar
Apr 26, 2006
love baos and bais

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I want to leave my current job and getting some kind of rails job instead... doesn't sound that bad compared to now I guess :smith:

Shaggar
Apr 26, 2006
u want asp.net 4.X or asp.net core

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

Mr Dog posted:

also don't forget to use logical shift >>> everywhere instead of arithmetic shift >>

because right shifting with sign extension is a thing that people want to do ever

x >> 32 is -1 if x is negative, and 0 if x is positive or 0. There's uses for that.

brap
Aug 23, 2004

Grimey Drawer

Shaggar posted:

u want asp.net 4.X

JewKiller 3000
Nov 28, 2006

by Lowtax

Zemyla posted:

x >> 32 is -1 if x is negative, and 0 if x is positive or 0. There's uses for that.

i can see absolutely no reason to ever do that instead of the perfectly clear "x < 0 ? -1 : 0"

Plorkyeran
Mar 22, 2007

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

he's not wrong, but you could s/un// and it'd be even more true. even with c's insane promotion rules signed numbers are way more complicated than unsigned

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

Shaggar posted:

thankfully ruby is dead as hell

except for chef!

also the 10xer here loving loooooves ruby and it makes me want to stand on his desk and take a poo poo on his keyboard

Zemyla
Aug 6, 2008

I'll take her off your hands. Pleasure doing business with you!

JewKiller 3000 posted:

i can see absolutely no reason to ever do that instead of the perfectly clear "x < 0 ? -1 : 0"

Not branching is a good thing, especially on embedded systems that don't have branch prediction.

Bloody
Mar 3, 2013

flushing a three stage pipeline isn't typically too disastrous and shift ops can be surprisingly hosed on a lot of embedded platforms. for example, the msp430 cannot shift, it can only rotate, so x >> 5 results in five rotate right instructions. byte aligned shifts will optimize to address offsets when optimizations are enabled at least.

also int32 >> 32 magically turning into just the sign seems extremely unlikely in c

Bloody
Mar 3, 2013

Probably better off either masking for the most significant bit and finding a way to make that useful on its own or doing something that would set the sign bit in the status register and masking that out if you're properly desperate and the status register layout happens to be just right

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
if you're assuming a naive implementation the java semantics require a branch anyway. no major processors turn large shifts into sign fills, they all mod by width

if you're not assuming a naive implementation then it is pretty easy to make either of those branchless even with a non-constant shift

cowboy beepboop
Feb 24, 2001

Zemyla posted:

Not branching is a good thing, especially on embedded systems that don't have branch prediction.

sufficiently smart compiler etc

qntm
Jun 17, 2009

Mr Dog posted:

Unicode consortium in the late 80s/early 90s: "It is absolutely possible to assign a code for every single glyph from every single human writing system in common use to a point in a 16-bit code point space. We are linguists, so you should trust us because we are experts in this field"

meanwhile in 2016, "It is absolutely possible to assign a code for every single glyph from every single human writing system in common use to a point in a 1,114,112 code point space"

and other people literally look at all of the extra space in Unicode and say "hey, we should use all of this extra space for something! no reason not to!"

CRIP EATIN BREAD posted:

utf-16 is a blight

utf-16 is also the main reason why we can never extend Unicode to more than 1,114,112 code points

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Bloody posted:

flushing a three stage pipeline isn't typically too disastrous and shift ops can be surprisingly hosed on a lot of embedded platforms. for example, the msp430 cannot shift, it can only rotate, so x >> 5 results in five rotate right instructions. byte aligned shifts will optimize to address offsets when optimizations are enabled at least.

also int32 >> 32 magically turning into just the sign seems extremely unlikely in c

shifting the number of bits that is the same as the width is undefined behavior

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
i spent a week debugging an issue because of that :(

Bloody
Mar 3, 2013

CRIP EATIN BREAD posted:

shifting the number of bits that is the same as the width is undefined behavior

yeah that's kind of what i figured but wasn't willing to commit to it in that post

crazypenguin
Mar 9, 2005
nothing witty here, move along

FamDav posted:

I'm going to call out into the void for a tef/monococqc paper dump

what's the good stuff in terms of formal verification/specification languages?

dunno what you're looking for, but the typical way to learn coq these days is Software Foundations

https://www.cis.upenn.edu/~bcpierce/sf/current/index.html

MrPablo
Mar 21, 2003

Mr Dog posted:

it's even stupider than that because char is unsigned

and 16-bit

:suicide:

And char doesn't necessarily represent a character (surrogate pairs).

Asshole Masonanie
Oct 27, 2009

by vyelkin
i'm gonna learn elm

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!
good, its very good

Adbot
ADBOT LOVES YOU

FamDav
Mar 29, 2008

crazypenguin posted:

dunno what you're looking for, but the typical way to learn coq these days is Software Foundations

https://www.cis.upenn.edu/~bcpierce/sf/current/index.html

I was mostly interested in seeing if anyone more educated than I had recommendations beyond what id found.

our service scheduler is growing in complexity as we extend it, and I'm interested in using something like tla+ for formal verification of behavior.

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