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.
 
  • Locked thread
quiggy
Aug 7, 2010

[in Russian] Oof.


Star War Sex Parrot posted:

void ** doesn't make much sense to me since I'm guessing that someone would try to use it to keep track of a 2d array. however, you can't do pointer arithmetic on void pointers which also means you can't index into this structure.

maybe i'm wrong on why the spec doesn't allow what you're trying, but that seems like a reasonable guess to me.

edit: ^^^ that makes more sense ^^^

c/c++ types can be a pain in the rear end to decode, but always remember the spiral rule: http://c-faq.com/decl/spiral.anderson.html

don't read char** as "char pointer pointer" or "char star star", read it as "pointer to a pointer to a char". when you put it this way it is very obvious why "pointer to a pointer to a char" cannot be cast to a "pointer to a pointer to a void"

Adbot
ADBOT LOVES YOU

Bloody
Mar 3, 2013

quiggy posted:

c/c++ types can be a pain in the rear end to decode, but always remember the spiral rule: http://c-faq.com/decl/spiral.anderson.html

don't read char** as "char pointer pointer" or "char star star", read it as "pointer to a pointer to a char". when you put it this way it is very obvious why "pointer to a pointer to a char" cannot be cast to a "pointer to a pointer to a void"

this is awful

Bloody
Mar 3, 2013

also it is not obvious why pointer to a pointer to a char cannot be cast to a pointer to a pointer to a void

quiggy
Aug 7, 2010

[in Russian] Oof.


Bloody posted:

this is awful

Welcome to the Republican Party C/C++ community.

Shaggar
Apr 26, 2006
here is a good rule for c/c++: don't use c/c++. use java or c#

Bloody
Mar 3, 2013

yeah lemme just compile c# for a microprocessor with 512 bytes of ram

quiggy
Aug 7, 2010

[in Russian] Oof.


c/c++ absolutely have their place, shaggar

not saying java/c# don't also have their place, ofc

Shaggar
Apr 26, 2006

Bloody posted:

yeah lemme just compile c# for a microprocessor with 512 bytes of ram

add more ram. ram is cheap

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





Condiv posted:

nah, scala is good

the scala i write is good, the scala everyone else writes is atrocious

uncurable mlady posted:

most of the scala love I see around here is for akka

akka is the worst. looks good in blogposts, is basically unuseable in real applications

Star War Sex Parrot
Oct 2, 2003

Shaggar posted:

add more ram. ram is cheap
is the memory controller?

Bloody
Mar 3, 2013

ram is actually insanely expensive

Bloody
Mar 3, 2013

quiggy posted:

c/c++ absolutely have their place, shaggar

not saying java/c# don't also have their place, ofc

c has a place, c++'s place is the dumpster

quiggy
Aug 7, 2010

[in Russian] Oof.


Bloody posted:

c has a place, c++'s place is the dumpster

i would love an actual competitor to c++'s combination of speed, deployability, and object-orientedness, but sadly there isnt one

JawnV6
Jul 4, 2004

So hot ...
ADT's lol

Bloody
Mar 3, 2013

quiggy posted:

i would love an actual competitor to c++'s combination of speed, deployability, and object-orientedness, but sadly there isnt one

rust lol

oh no blimp issue
Feb 23, 2011

Bloody posted:

rust lol

Asymmetrikon
Oct 30, 2009

I believe you're a big dork!

Bloody posted:

rust lol

maybe one day we will enter that blessed future

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Bloody posted:

rust unironically

quiggy
Aug 7, 2010

[in Russian] Oof.


loaded up a rust tutorial because bossman is out today and im bored

lmao why the gently caress are the print functions actually macros

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

more like dICK posted:

Are there still any red hat employees in here

hi

quiggy
Aug 7, 2010

[in Russian] Oof.


code:
fn area(&self) -> f64 {}
lomarf

quiggy
Aug 7, 2010

[in Russian] Oof.


quote:

The for in construct can be used to iterate through an Iterator. One of the easiest ways to create an iterator is to use the range notation a..b. This yields values from a (inclusive) to b (exclusive) in steps of one.

lollin' real hard over here

VikingofRock
Aug 24, 2008




quiggy posted:

loaded up a rust tutorial because bossman is out today and im bored

lmao why the gently caress are the print functions actually macros

Regular functions in Rust can't take a variable number of arguments. Also macros in Rust are not nearly the horrorshow that they are in C/C++ and you should not fear them.

quiggy
Aug 7, 2010

[in Russian] Oof.


VikingofRock posted:

Regular functions in Rust can't take a variable number of arguments.

please, im dying

VikingofRock
Aug 24, 2008




Also the other stuff you posted is... not horrifying? Like it's different syntax than C, but who cares? It all compiles to the same thing and I don't really think the Rust syntax is any less readable.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

quiggy posted:



lmao why the gently caress are the print functions actually macros

i want printing to be plang easy but I want the language to be type safe and memory safe. macros are a *good way to accomplish this.

triple sulk
Sep 17, 2014



quiggy posted:

loaded up a rust tutorial because bossman is out today and im bored

lmao why the gently caress are the print functions actually macros

rust is what happens when you let a bunch of ruby devs design a systems language

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
most plangers don't really use runtime dynamism, they use dynamism to make writing code easier. you can use Marcos to allow dynamic language features without being dynamic at runtime

. it's a good thing

Shaggar
Apr 26, 2006

quiggy posted:

i would love an actual competitor to c++'s combination of speed, deployability, and object-orientedness, but sadly there isnt one

java or c#

Bloody
Mar 3, 2013

quiggy posted:

loaded up a rust tutorial because bossman is out today and im bored

lmao why the gently caress are the print functions actually macros

said the user of the language that uses shift operators for stdio

Bloody
Mar 3, 2013

Shaggar posted:

java or c#

i may love c# but c# is not exactly performant. ffi is p easy tho so calling out to performant fortran/c libs (or anything c-like) is not that scary

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
like almost every time I've written dynamic code in ruby, it's to implement some dsl thing that is resolved just after application initialization. with macros you get to push that stuff to compile time.

Bloody
Mar 3, 2013

ask me about the performance boost garbage-nn got from using native matrix libs vs managed code

quiggy
Aug 7, 2010

[in Russian] Oof.


VikingofRock posted:

Also the other stuff you posted is... not horrifying? Like it's different syntax than C, but who cares? It all compiles to the same thing and I don't really think the Rust syntax is any less readable.

any language where you have to explicitly declare self/this or w/e is loving awful, hth

Bloody posted:

said the user of the language that uses shift operators for stdio

technically those are insertion/extraction operators and are just spelled the same way :smug: anyway i use c++ daily because it pays my bills, not because i have any great love for the language

Shaggar posted:

java or c#

*writes embedded code in java*

cinci zoo sniper
Mar 15, 2013




Bloody posted:

ram is actually insanely expensive
its like $4/gb nowadays

Bloody
Mar 3, 2013

there are costs other than money

quiggy
Aug 7, 2010

[in Russian] Oof.


realtalk the module im currently writing at work has to parse ~2 million data points and generate meaningful information every tick. each tick is .1 seconds, and im lucky if im allotted 1/10th that for a single pass through my module. the code runs on embedded systems deployed in remote locations on a wide variety of hardware

please tell me the language i should be using if not c/c++

Bloody
Mar 3, 2013

also in a lot of embedded contexts $4 on the bom is outrageously expensive

Bloody
Mar 3, 2013

quiggy posted:

realtalk the module im currently writing at work has to parse ~2 million data points and generate meaningful information every tick. each tick is .1 seconds, and im lucky if im allotted 1/10th that for a single pass through my module. the code runs on embedded systems deployed in remote locations on a wide variety of hardware

please tell me the language i should be using if not c/c++

define embedded systems and meaningful information. 100ms is anywhere between a lifetime or an instant

Adbot
ADBOT LOVES YOU

Star War Sex Parrot
Oct 2, 2003

why hasn't someone designed a strict subset of C or new language for embedded applications that takes inspiration from stuff like JPL's coding standards and MISRA-C

that still would save some time over writing assembly

is it because the range of constraints are still too broad to be defined rigidly for a "language for embedded systems"

Bloody posted:

define embedded systems and meaningful information. 100ms is anywhere between a lifetime or an instant
basically this problem i guess?

  • Locked thread