|
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 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.
|
# ? Apr 3, 2013 16:26 |
|
|
# ? Jun 7, 2024 02:18 |
|
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
|
# ? Apr 3, 2013 16:31 |
|
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
|
# ? Apr 3, 2013 16:34 |
|
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
|
# ? Apr 3, 2013 16:37 |
|
Jonny 290 posted:I might be learning some more Python to use the Ableton API some and script poo poo out. pythowns
|
# ? Apr 3, 2013 16:38 |
|
PrBacterio posted:I vote we return to word-addressed cpu architectures so as to avoid the whole endianness bs entirely
|
# ? Apr 3, 2013 16:39 |
|
Jonny 290 posted:I might be learning some more Python to use the Ableton API some and script poo poo out. ableton live has an api?
|
# ? Apr 3, 2013 16:40 |
|
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.
|
# ? Apr 3, 2013 16:44 |
|
why would you write desktop software in C in the year 2013.
|
# ? Apr 3, 2013 16:46 |
|
yeah havent you heard of c++?
|
# ? Apr 3, 2013 16:51 |
|
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).
|
# ? Apr 3, 2013 16:52 |
|
I also do embedded Linux, and string manipulation is great if you are parsing information from other programs.
|
# ? Apr 3, 2013 16:52 |
|
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.
|
# ? Apr 3, 2013 16:54 |
|
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
|
# ? Apr 3, 2013 16:54 |
|
Werthog 95 posted:somebody who actually knows anything about anything, please correct me if i'm wrong, but it seems to me that this: It is if you are lazy and don't want to deal with strncat.
|
# ? Apr 3, 2013 16:56 |
|
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) turns out multiplying two 32 bit integers needs 64 bits of precision also switchable endian mcus are the greatest!
|
# ? Apr 3, 2013 16:57 |
|
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?
|
# ? Apr 3, 2013 16:57 |
|
oh ok so you're an idiot. gotcha
|
# ? Apr 3, 2013 16:58 |
|
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?
|
# ? Apr 3, 2013 17:01 |
|
either plang or don't. you wanna be the embedded dude, this is what you get
|
# ? Apr 3, 2013 17:02 |
|
Can't a man dream that his clang has *some* plang features? Why is that so bad? I want interacial langs!
|
# ? Apr 3, 2013 17:03 |
|
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.
|
# ? Apr 3, 2013 17:07 |
|
ratbert90 posted:Can't a man dream that his clang has *some* plang features? Why is that so bad? I want interacial langs! C#
|
# ? Apr 3, 2013 17:13 |
|
clang clang clang goes the trolley
|
# ? Apr 3, 2013 17:15 |
|
isn't embedded .net even a thing
|
# ? Apr 3, 2013 17:16 |
|
Werthog 95 posted:isn't embedded .net even a thing I like touching my bits.
|
# ? Apr 3, 2013 17:20 |
|
Werthog 95 posted:isn't embedded .net even a thing ya
|
# ? Apr 3, 2013 17:21 |
|
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.
|
# ? Apr 3, 2013 17:27 |
|
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 |
# ? Apr 3, 2013 17:29 |
|
they made some stupid decisions though. for example:C# code:
|
# ? Apr 3, 2013 17:30 |
|
but how else are you supposed to handle overflow!
|
# ? Apr 3, 2013 17:33 |
|
Default promotion inherited from java
|
# ? Apr 3, 2013 17:34 |
|
HappyHippo posted:they made some stupid decisions though. for example: Yeah, it pisses me off how much this hamstrings anything but int and long (as far as integer types go).
|
# ? Apr 3, 2013 17:37 |
|
Werthog 95 posted:isn't embedded .net even a thing .net micro framework, used on 1 arduino clone
|
# ? Apr 3, 2013 17:58 |
|
yaoi prophet posted:es6 seems like it'll actually fix a lot of the bad poo poo about js as a language 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
|
# ? Apr 3, 2013 18:05 |
|
spongeh posted:nope the shims don't support that, which is unfortunate. i forgot about that part of maps of course they do
|
# ? Apr 3, 2013 18:10 |
|
HappyHippo posted:they made some stupid decisions though. for example: I never wanted to remember this poo poo again
|
# ? Apr 3, 2013 18:10 |
|
Malcolm XML posted:.net micro framework, used on 1 arduino clone don't forget windows sideshow
|
# ? Apr 3, 2013 18:20 |
|
This is what you folks get for not using a real type system.
|
# ? Apr 3, 2013 18:24 |
|
|
# ? Jun 7, 2024 02:18 |
|
Basically this thread needs more :nsfw:flang:nsfw:
|
# ? Apr 3, 2013 18:52 |