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
tractor fanatic
Sep 9, 2005

Pillbug

Malcolm XML posted:

this is actually legit and serves everyone right for not using a language with precise standards

undefined behavior is dumb as hell and shouldn't be in any so called standard

can you even talk about race conditions without undefined behavior

Adbot
ADBOT LOVES YOU

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

Malcolm XML posted:

someones making different assumptions about numeric precision

probs in the stdlib

have fun

Is this some matrix multiplying poo poo? Numerical stability matters.

Fuck them
Jan 21, 2011

and their bullshit
:yotj:

tef posted:

moral: languages should expose ints and rationals, and not floats. you should have to ask to be hosed over by floating point

Don't almost all languages worth half a gently caress come with some kind of Decimal of BigNum in the standard library if not something put together nicely from a third party?

Notorious b.s.d.
Jan 25, 2003

by Reene

gently caress them posted:

Don't almost all languages worth half a gently caress come with some kind of Decimal of BigNum in the standard library if not something put together nicely from a third party?

no.

as far as i can recall java was the first major language to have Decimal and BigNum in the stdlib. (and even then it still includes really dodgy painful platform-specific float behavior. a 'float' on x86 is different from 'float' on sparc)

i'm sure you can dig up some forgotten research language that beat it to the punch, but the dominant choices at the time had fuckall. (c, c++, pascal, scripting languages)

Notorious b.s.d. fucked around with this message at 07:05 on Jul 19, 2014

Cybernetic Vermin
Apr 18, 2005

Notorious b.s.d. posted:

as far as i can recall java was the first major language to have Decimal and BigNum in the stdlib. (and even then it still includes really dodgy painful platform-specific float behavior. a 'float' on x86 is different from 'float' on sparc)

and even that is slightly unfair since java started out doing that better than pretty much anything coming before it, as strictfp was the only mode up until 1.2, when it was complained about enough to just become an option

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

JewKiller 3000 posted:

here's john regehr on when he thinks undefined behavior is ok: http://blog.regehr.org/archives/748. anyone who wants a good overview of undefined behavior in C/C++ should follow the link in his first paragraph

see I think you need to explicitly opt into undefined behavior

like I'm totally fine with people turning on -ffast-math and dealing with non associative go math

c is a stuck because neck beards won't let it evolve even when it's zero cost

Sapozhnik
Jan 2, 2005

Nap Ghost
Everything hyped up to replace C is worse.

If your C replacement requires any sort of runtime beyond "Set the stack pointer and call main then invoke the exit process syscall with the return value" or can't run on bare metal then it is a fail.

Which is a shame because C could really do with multi-pass compilation, a module system, and the ability to directly control the layout of structures and unions. Also correct precedence rules for the bitwise operators would be nice.

Obviously I'm not saying C is perfect, I'm saying for the sorts of things that C does C is still the best tool for the job. Please don't write your OS kernel in C++.

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Mr Dog posted:

Everything hyped up to replace C is worse.

If your C replacement requires any sort of runtime beyond "Set the stack pointer and call main then invoke the exit process syscall with the return value" or can't run on bare metal then it is a fail.

Which is a shame because C could really do with multi-pass compilation, a module system, and the ability to directly control the layout of structures and unions. Also correct precedence rules for the bitwise operators would be nice.

Obviously I'm not saying C is perfect, I'm saying for the sorts of things that C does C is still the best tool for the job. Please don't write your OS kernel in C++.

why not


just cause u need a tiny shim of assemby lang or C doesn't mean the entire loving thing needs to be written in C

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Mr Dog posted:

Everything hyped up to replace C is worse.

If your C replacement requires any sort of runtime beyond "Set the stack pointer and call main then invoke the exit process syscall with the return value" or can't run on bare metal then it is a fail.

Which is a shame because C could really do with multi-pass compilation, a module system, and the ability to directly control the layout of structures and unions. Also correct precedence rules for the bitwise operators would be nice.

Obviously I'm not saying C is perfect, I'm saying for the sorts of things that C does C is still the best tool for the job. Please don't write your OS kernel in C++.

its possible to have a minimal runtime (i.e. literally 0 if u want https://github.com/charliesome/rustboot) in rust

this comes at 0 cost, u still get the compile time memeory safety and lifetime checking

C is still built on the assumption that the lovely microcontroller u r using is running the compiler

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker
why hasn't d taken off it seems like its good

Dicky B
Mar 23, 2004

because its bad

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Dicky B posted:

because its bad

yeah it has gc which is a no-no

Dicky B
Mar 23, 2004

i dont think gc is inherently bad even though i prefer smart pointers and stuff for automatic memory management. the problem with D is its not a big enough improvement over C++ to endure the garbage tools, small community and lack of momentum. it's just the same old poo poo with a cacophony of bells and whistles super glued to the sides. c++ is already heading in that direction now anyway so D is irrelevant

Squinty Applebottom
Jan 1, 2013

ya but those forums tho

Soricidus
Oct 21, 2010
freedom-hating statist shill
did they ever decide which of the two competing standard libraries you should use?

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Dicky B posted:

i dont think gc is inherently bad even though i prefer smart pointers and stuff for automatic memory management. the problem with D is its not a big enough improvement over C++ to endure the garbage tools, small community and lack of momentum. it's just the same old poo poo with a cacophony of bells and whistles super glued to the sides. c++ is already heading in that direction now anyway so D is irrelevant

again i rly like rust for this role

small, consistent, solves a lot of the issues that plague c++


has nice poo poo like real macros


for webdev im big on cljs

Bloody
Mar 3, 2013

does rust have compilers targeting various embedded architectures

Vanadium
Jan 8, 2005

can't even implement a doubly-linked list from scratch without unsafe code

has a module/linking system that's actually harder to understand than C's lack of one

Vanadium
Jan 8, 2005

rust has a compiler targetting llvm and sorta works with some arm or other, idk

Nomnom Cookie
Aug 30, 2009



Vanadium posted:

can't even implement a doubly-linked list from scratch without unsafe code

has a module/linking system that's actually harder to understand than C's lack of one

c and c++ can't implement anything ever without unsafe code. is that really a disadvantage of rust?

pseudorandom name
May 6, 2007

compared to Java and C# and lots of other languages, yes

Vanadium
Jan 8, 2005

Kevin Mitnick P.E. posted:

c and c++ can't implement anything ever without unsafe code. is that really a disadvantage of rust?

just saying that the compile time lifetime checking comes with some pretty harsh restrictions, bare-metal rust isn't just C but safe somehow

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Vanadium posted:

can't even implement a doubly-linked list from scratch without unsafe code

has a module/linking system that's actually harder to understand than C's lack of one

lol

whoosh

implement a dll once then use it safely everywhere else

the idea is to limit the amount of unsafe code to tiny ghettoes rather than littering pointer fuckery everywhere

modern c++ rarely deals with raw pointers


also the zinc project has some arm micros but it's limited to back ends llvm supports

Malcolm XML
Aug 8, 2009

I always knew it would end like this.
tbh if u want it on a tiny micro then I doubt it gonna go places but c on a tiny micro is barely better than asm anyway

Notorious b.s.d.
Jan 25, 2003

by Reene

Malcolm XML posted:

implement a dll once then use it safely everywhere else

the idea is to limit the amount of unsafe code to tiny ghettoes rather than littering pointer fuckery everywhere

notably rust has a doubly linked list in the std lib already

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

Malcolm XML posted:

tbh if u want it on a tiny micro then I doubt it gonna go places but c on a tiny micro is barely better than asm anyway

that's not remotely true. c on a uC is much better than writing asm (you'll have to read asm occasionally of course, if only to tell whether the bespoke gcc port with five end users or keil or whatever compiler you're using is generating something sane when questions come up, or whether memory mapped writes are actually taking place, etc). i take it you've never done either, forums user Malcolm XML

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Otto Skorzeny posted:

that's not remotely true. c on a uC is much better than writing asm (you'll have to read asm occasionally of course, if only to tell whether the bespoke gcc port with five end users or keil or whatever compiler you're using is generating something sane when questions come up, or whether memory mapped writes are actually taking place, etc). i take it you've never done either, forums user Malcolm XML

not in anger

but the tiny stuff i made a tinyavr or whatever do wasn't much nicer than writing them in assembly

maybe for the tiny but not that tiny microcontrollers it's better but they can afford better tools than c

Bloody
Mar 3, 2013

what tool better than c should i be using for my msp430, forums user malcolm xml

Bloody
Mar 3, 2013

Otto Skorzeny posted:

that's not remotely true. c on a uC is much better than writing asm (you'll have to read asm occasionally of course, if only to tell whether the bespoke gcc port with five end users or keil or whatever compiler you're using is generating something sane when questions come up, or whether memory mapped writes are actually taking place, etc). i take it you've never done either, forums user Malcolm XML

Phobeste
Apr 9, 2006

never, like, count out Touchdown Tom, man

Otto Skorzeny posted:

that's not remotely true. c on a uC is much better than writing asm (you'll have to read asm occasionally of course, if only to tell whether the bespoke gcc port with five end users or keil or whatever compiler you're using is generating something sane when questions come up, or whether memory mapped writes are actually taking place, etc). i take it you've never done either, forums user Malcolm XML

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
i am starting to work with uCs and after looking at the options available for langs i already know (c++, c#, comedy option objc) i ended up deciding to just go with c

if there is a better lang for me to use that doesn't have severe drawbacks (c++ has code size problems, c# is just lol) I'm all ears, I'm down to learn a new modern lang for this

Bloody
Mar 3, 2013

what sort of uCs

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...
arduino-compatible, basically just looking to make some clothes that sparkle and respond to midi/sound

I'm using adafruit's flora

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
have you considered using ruby motion

Dessert Rose
May 17, 2004

awoken in control of a lucid deep dream...

USSMICHELLEBACHMAN posted:

have you considered using ruby motion

:suicide:

Soricidus
Oct 21, 2010
freedom-hating statist shill
just use c, it is a good language and suitable for the task

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

Bloody posted:

what tool better than c should i be using for my msp430, forums user malcolm xml

i once tried writing a backend for llvm msp430 base don the gcc backend but i ran away screaming

use c or something that compiles down to c

Malcolm XML
Aug 8, 2009

I always knew it would end like this.

tractor fanatic posted:

can you even talk about race conditions without undefined behavior

it's possible to analyze these formally issuing eg tla+ or lvars

I kinda think race conditions are usually chaotic as opposed to non deterministic but thatmdoesnt help much

Corla Plankun
May 8, 2007

improve the lives of everyone
is there a thing like cweb for newer languages?

i like the idea of being able to put latex in comments but i can't bear to use any language that doesn't have trivially easy string manipulation when i am off the clock

Adbot
ADBOT LOVES YOU

yippee cahier
Mar 28, 2005

how is clang+llvm in the embedded ARM world now? i did some looking into it and it looks like a real pain to get a full toolchain together. i'm currently using gcc arm embedded and they bundle binutils, newlib, etc. into one package and it's alright. anyone doing something similar with llvm?

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