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
Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

PrBacterio posted:

i for reals hosed this up on a work assignment a couple of weeks ago, writing a simple udp protocol in C++, no big deal right? well when I (thought I was) done we were all wondering why it didn't work, turns out I forgot to use htons to convert the port number before some call, so port 8800 became something like 24610
Imean, why on earth does it require the bytes in the port value to be manually swapped before passing it to the function to open a socket though



I'm currently kicking myself that I left the data dumping format for my current project in my mcu's default byte order (which is little-endian, contrary to what I had assumed. rear end/you/me etc), making the output difficult to eyeball which was the whole point of having a data dump. Blurg.

Adbot
ADBOT LOVES YOU

PrBacterio
Jul 19, 2000
I vote we return to word-addressed cpu architectures so as to avoid the whole endianness bs entirely
I mean thats basically how cpus already work internally anyway, its words all the way down to the memory bus interface bytes only come into play when the cpu masks out irrelevant parts of whatever word its working with, all of which might just as well be done in software, like they used to

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

PrBacterio posted:

why on earth does it require the bytes in the port value to be manually swapped before passing it to the function to open a socket though

Because you're using a lovely language with a lovely library that hates it's users

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
I might be learning some more Python to use the Ableton API some and script poo poo out.

complete tangential derail, feel free to ignore or follow. namaste

Posting Principle
Dec 10, 2011

by Ralp

Jonny 290 posted:

I might be learning some more Python to use the Ableton API some and script poo poo out.

complete tangential derail, feel free to ignore or follow. namaste

pythowns

uG
Apr 23, 2003

by Ralp

PrBacterio posted:

I vote we return to word-addressed cpu architectures so as to avoid the whole endianness bs entirely
I mean thats basically how cpus already work internally anyway, its words all the way down to the memory bus interface bytes only come into play when the cpu masks out irrelevant parts of whatever word its working with, all of which might just as well be done in software, like they used to
because some gently caress would insist there be an architectures to read words backwords

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

Jonny 290 posted:

I might be learning some more Python to use the Ableton API some and script poo poo out.

complete tangential derail, feel free to ignore or follow. namaste

ableton live has an api?

FlapYoJacks
Feb 12, 2009
To be fair, I think plangs are amazing when it comes to string handling, and I loving hate how C handles strings. Hell, most modern ~*~*Desktop*~*~ processors have string instructions built right in.

gently caress, make it an option in gcc to go string + string = newstring.

GameCube
Nov 21, 2006

why would you write desktop software in C in the year 2013.

uG
Apr 23, 2003

by Ralp
yeah havent you heard of c++?

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

ratbert90 posted:

Hell, most modern ~*~*Desktop*~*~ processors have string instructions built right in.

Well, sort of. The string instructions, like many of the really CISCy parts of x86 have not been implemented for speed rather than mininal transistor count since the 486 days and are indeed often slower than doing simpler instructions in a loop (although if you're doing demos or whatever some of the looping instructions are still worthwhile i think in order to get your footprint down).

FlapYoJacks
Feb 12, 2009
I also do embedded Linux, and string manipulation is great if you are parsing information from other programs.

FlapYoJacks
Feb 12, 2009

Otto Skorzeny posted:

Well, sort of. The string instructions, like many of the really CISCy parts of x86 have not been implemented for speed rather than mininal transistor count since the 486 days and are indeed often slower than doing simpler instructions in a loop (although if you're doing demos or whatever some of the looping instructions are still worthwhile i think in order to get your footprint down).

That does make sense, I just want easy string manipulation like other plangs. :(

GameCube
Nov 21, 2006

somebody who actually knows anything about anything, please correct me if i'm wrong, but it seems to me that this:

ratbert90 posted:

gently caress, make it an option in gcc to go string + string = newstring.

is not something anybody who understands c strings would ever suggest

FlapYoJacks
Feb 12, 2009

Werthog 95 posted:

somebody who actually knows anything about anything, please correct me if i'm wrong, but it seems to me that this:


is not something anybody who understands c strings would ever suggest

It is if you are lazy and don't want to deal with strncat.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Suspicious Dish posted:

i know about the standard twos complement signed integer representations (the de facto standard due to ease of implementation, but not the only one, there's also some endianness bullshit)

i know about floats and doubles and ieee754. i also know that integers from -(2^52)+1 to (2^52)-1 can be stored in a double without any loss in precision because thats how doubles work.

if on most days you work with 32-bit integers you can work with doubles without any care. also most js engines optimize operations like this to integers so it doesnt matter anyway

turns out multiplying two 32 bit integers needs 64 bits of precision


also switchable endian mcus are the greatest!

GameCube
Nov 21, 2006

like, what, you want to overload the + operator so you don't have to type strcat? or do you want it to call malloc for you too, so now you suddenly have memory you have to free that you didn't explicitly allocate? how do you handle strings that aren't null terminated?

GameCube
Nov 21, 2006

oh ok so you're an idiot. gotcha

FlapYoJacks
Feb 12, 2009

Werthog 95 posted:

like, what, you want to overload the + operator so you don't have to type strcat? or do you want it to call malloc for you too, so now you suddenly have memory you have to free that you didn't explicitly allocate? how do you handle strings that aren't null terminated?

Hey man, I'm not thinking to hard about this OK? I have been writing a wireless API that outputs to a custom built web-server and in the process I have done more string manipulation than I care to ever do again. I'm not bad at it by any means and completely understand it. I am just getting lazy OK? :smith:

GameCube
Nov 21, 2006

either plang or don't. you wanna be the embedded dude, this is what you get

FlapYoJacks
Feb 12, 2009
Can't a man dream that his clang has *some* plang features? Why is that so bad? I want interacial langs!

Blotto Skorzany
Nov 7, 2008

He's a PSoC, loose and runnin'
came the whisper from each lip
And he's here to do some business with
the bad ADC on his chip
bad ADC on his chiiiiip

ratbert90 posted:

Can't a man dream that his clang has *some* plang features? Why is that so bad?

quote:

6 Ere now, looking down from my window through the lattice, 7 I have watched the thoughtless crowd, and seen some gallant, more insensate than the rest, 8 crossing the street at the corner where such a woman dwells. Now his steps are taking him near that abode of hers; 9 the day wanes, and the light fades; night spreads her pall of darkness. 10 Who comes to meet him? A woman in right harlot’s guise, that goes out, ready of speech, to hunt men’s lives. 11 No rest for her, stay at home she cannot; 12 ever in street and market-place she lies in ambush, at some corner of the ways. 13 She draws him to herself and kisses him, flattering him with her bold speech: 14 Only to-day I have paid a vow that I owed for my preservation, and here are my victims freshly killed; 15 so I came out to find thee, longing for the sight of thee, and here thou art! 16 Soft, soft I have made my bed, spread it with embroidered tapestries of Egyptian woof; 17 freshly scented is that bower of mine with myrrh, and aloes, and cinnamon. 18 Come, let us lose ourselves in dalliance, all the night through let us enjoy the long-desired embrace. 19 My home stands masterless, my husband far away, 20 and his purse with him; no fear of his returning till the moon is full.

21 Alas, the ready speech that beguiles him, the seducing lips that lead him captive away! 22 He follows without more ado, unwitting as the ox that goes to the shambles, or a frisking lamb;[1] nor knows what fetters await him, 23 till the shaft is already deep in his bosom. So joyfully flies bird into snare, heedless of its life’s peril. 24 Heed me well, my son; let not this warning be given in vain; 25 do not let her steal thy heart away, do not be enticed by her beckoning. 26 Many the wounds such a woman has dealt; a brave retinue she has of men murdered; 27 truly her house is the grave’s ante-chamber, opens the door into the secret closet of death.

NOTinuyasha
Oct 17, 2006

 
The Great Twist

ratbert90 posted:

Can't a man dream that his clang has *some* plang features? Why is that so bad? I want interacial langs!

C#

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band
clang clang clang goes the trolley

GameCube
Nov 21, 2006

isn't embedded .net even a thing

FlapYoJacks
Feb 12, 2009

Werthog 95 posted:

isn't embedded .net even a thing

I like touching my bits.

Shaggar
Apr 26, 2006

Werthog 95 posted:

isn't embedded .net even a thing

ya

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
c# is nice when you want to write a program to talk to your embedded stuff. java meanwhile thinks youre too dumb to handle unsigned ints.

Nomnom Cookie
Aug 30, 2009



ratbert90 posted:

He didn't know how ints work and he certainly doesn't know about memory. Why don't you get out you obsolete piece of poo poo operating system.

Are you talking about me. Because I know how memory works I just don't care. The JVM does a good enough job abstracting it away that it's relevant to me a couple times a year at most

Nomnom Cookie fucked around with this message at 17:33 on Apr 3, 2013

HappyHippo
Nov 19, 2003
Do you have an Air Miles Card?
they made some stupid decisions though. for example:

C# code:
byte x = 1, y = 2, z;
z = x + y;
is an error, because the type of (byte) + (byte) is an int for some reason. so you have to cast it back to a byte. i think the same is true of int16s. this results in a lot of bullshit casts all over the place.

hobbesmaster
Jan 28, 2008

but how else are you supposed to handle overflow!

Nomnom Cookie
Aug 30, 2009



Default promotion inherited from java

Condiv
May 7, 2008

Sorry to undo the effort of paying a domestic abuser $10 to own this poster, but I am going to lose my dang mind if I keep seeing multiple posters who appear to be Baloogan.

With love,
a mod


HappyHippo posted:

they made some stupid decisions though. for example:

C# code:
byte x = 1, y = 2, z;
z = x + y;
is an error, because the type of (byte) + (byte) is an int for some reason. so you have to cast it back to a byte. i think the same is true of int16s. this results in a lot of bullshit casts all over the place.

Yeah, it pisses me off how much this hamstrings anything but int and long (as far as integer types go).

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Werthog 95 posted:

isn't embedded .net even a thing

.net micro framework, used on 1 arduino clone

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION

yaoi prophet posted:

es6 seems like it'll actually fix a lot of the bad poo poo about js as a language

do the shims do anything to let you use arbitrary objects as a key? that's the thing that really annoyed me

nope the shims don't support that, which is unfortunate. i forgot about that part of maps

HappyHippo posted:

javascript has some bad parts (no integers, no proper arrays) but its not deserving of the amount of hate it gets. closures are awesome and javascript does them really well. i also like the object literal notation. and it can be kinda fun to write. heres a game i made

again if you're willing to not bother supporting old IE (<10) you have the option of using typed arrays. https://developer.mozilla.org/en-US/docs/JavaScript/Typed_arrays

Int8Array, Int16Array, Int32Array
Uint8Array, Uint16Array, Uint32Array, Uint8ClampedArray
Float32Array, Float64Array

it was mostly meant for webgl but it's found use outside

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe

spongeh posted:

nope the shims don't support that, which is unfortunate. i forgot about that part of maps

of course they do

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

HappyHippo posted:

they made some stupid decisions though. for example:

C# code:
byte x = 1, y = 2, z;
z = x + y;
is an error, because the type of (byte) + (byte) is an int for some reason. so you have to cast it back to a byte. i think the same is true of int16s. this results in a lot of bullshit casts all over the place.

:suicide: I never wanted to remember this poo poo again

GameCube
Nov 21, 2006

Malcolm XML posted:

.net micro framework, used on 1 arduino clone

don't forget windows sideshow

Zombywuf
Mar 29, 2008

This is what you folks get for not using a real type system.

Adbot
ADBOT LOVES YOU

Zombywuf
Mar 29, 2008

Basically this thread needs more :nsfw:flang:nsfw:

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