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
Notorious b.s.d.
Jan 25, 2003

by Reene

Police Academy III posted:

so a guy at work was unironically pushing for us to switch our javascript to dart. looking at the wiki page it doesn't look terrible if not very exciting, basically like the web version of go. has anybody actually used it or looked at it or given a poo poo about it? or is it just gwt 2.0?

like golang, in five years it will be totally forgotten but still widely-deployed inside google

Adbot
ADBOT LOVES YOU

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION

Police Academy III posted:

so a guy at work was unironically pushing for us to switch our javascript to dart. looking at the wiki page it doesn't look terrible if not very exciting, basically like the web version of go. has anybody actually used it or looked at it or given a poo poo about it? or is it just gwt 2.0?

if you're dead set on using something new, write in ES6 and convert it to lesser targets. at least in 5 years you won't have abandoned code.

pseudorandom name
May 6, 2007

Notorious b.s.d. posted:

having a well-specified standard means that when i want to interoperate with a french mainframe, an american minicomputer from the 1970s, and a japanese warehouse running Windows, i'm gonna use xml

[insert story about mumps xml parser that was based purely on predetermined byte offsets here]

X-BUM-RAIDER-X
May 7, 2008
so what's the ironic yospos take on parsing .ini style key value stores?

Brain Candy
May 18, 2006

just write a distributed map-reduce in Erlang. easy.

Suspicious Dish
Sep 24, 2011

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

Brain Candy posted:

just write a distributed map-reduce in Erlang. easy.

i believe i did, bob

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

OBAMA BIN LinkedIn posted:

so what's the ironic yospos take on parsing .ini style key value stores?

the best way to do human-editable config. yaml can go suck a bag of dicks

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
bought an impreza outback yesterday, good tymes

suffix
Jul 27, 2013

Wheeee!

Notorious b.s.d. posted:

having a well-specified standard means that when i want to interoperate with a french mainframe, an american minicomputer from the 1970s, and a japanese warehouse running Windows, i'm gonna use xml

i really don't want to hack up my own agreed standard around french-codepage EBCDIC and windows shift-jis json

well guess what, those xml interfaces are going to be just as broken and ad-hoc as any json parser.

like one of them ignores any encoding you specify and just reads everything as ISO-8859-15,
and one of them runs a bunch of perl regexes on the input and fails if you have whitespace in a self-closing tag,
and one of them just uses print statements and doesn't escape any output data.

Brain Candy
May 18, 2006

i like config files when i do them

pros :
editable by human beings in text editors

cons :
editable by human beings in text editors
is white space significant?
are there literal quotes?
how the gently caress does this thing read umlats?
wait, how I make escape sequence?
poo poo pissssssssssss why am I worrying about line separators?!

Salynne
Oct 25, 2007

Brain Candy posted:

pros :
editable by human beings in text editors

cons :
editable by human beings in text editors

Brain Candy
May 18, 2006

suffix posted:

well guess what, those xml interfaces are going to be just as broken and ad-hoc as any json parser.

like one of them ignores any encoding you specify and just reads everything as ISO-8859-15,
and one of them runs a bunch of perl regexes on the input and fails if you have whitespace in a self-closing tag,
and one of them just uses print statements and doesn't escape any output data.

the ability to have "UTF-8" as part of the header and to be able to say, "no gently caress you, it doesn't validate against the schema" is a beautiful thing.

you can't stop idiots from making undocumented formats that work as implemented. this doesn't mean you have to go back to the world where your programs eat literal garbage.

Zlodo
Nov 25, 2006
re: config files, unironically just write a parser

you can define a grammar + parse a file using it in a few lines of code in c++ with a good parsing library

Nomnom Cookie
Aug 30, 2009



Otto Skorzeny posted:

bought an impreza outback yesterday, good tymes

U mean the turbo hatchback? I'm jelly

Shaggar
Apr 26, 2006

OBAMA BIN LinkedIn posted:

so what's the ironic yospos take on parsing .ini style key value stores?

java style properties files are pretty straight forward

markerstore
Dec 5, 2003
Canny!

Notorious b.s.d. posted:

like golang, in five years it will be totally forgotten but still widely-deployed inside google

it won't even be that

Soricidus
Oct 21, 2010
freedom-hating statist shill

Shaggar posted:

java style properties files are pretty straight forward
Properties are processed in terms of lines. There are two kinds of line, natural lines and logical lines. A natural line is defined as a line of characters that is terminated either by a set of line terminator characters (\n or \r or \r\n) or by the end of the stream. A natural line may be either a blank line, a comment line, or hold all or some of a key-element pair. A logical line holds all the data of a key-element pair, which may be spread out across several adjacent natural lines by escaping the line terminator sequence with a backslash character \. Note that a comment line cannot be extended in this manner; every natural line that is a comment must have its own comment indicator, as described below. Lines are read from input until the end of the stream is reached.

A natural line that contains only white space characters is considered blank and is ignored. A comment line has an ASCII '#' or '!' as its first non-white space character; comment lines are also ignored and do not encode key-element information. In addition to line terminators, this format considers the characters space (' ', '\u0020'), tab ('\t', '\u0009'), and form feed ('\f', '\u000C') to be white space.

If a logical line is spread across several natural lines, the backslash escaping the line terminator sequence, the line terminator sequence, and any white space at the start of the following line have no affect on the key or element values. The remainder of the discussion of key and element parsing (when loading) will assume all the characters constituting the key and element appear on a single natural line after line continuation characters have been removed. Note that it is not sufficient to only examine the character preceding a line terminator sequence to decide if the line terminator is escaped; there must be an odd number of contiguous backslashes for the line terminator to be escaped. Since the input is processed from left to right, a non-zero even number of 2n contiguous backslashes before a line terminator (or elsewhere) encodes n backslashes after escape processing.

The key contains all of the characters in the line starting with the first non-white space character and up to, but not including, the first unescaped '=', ':', or white space character other than a line terminator. All of these key termination characters may be included in the key by escaping them with a preceding backslash character; for example,

\:\=

would be the two-character key ":=". Line terminator characters can be included using \r and \n escape sequences. Any white space after the key is skipped; if the first non-white space character after the key is '=' or ':', then it is ignored and any white space characters after it are also skipped. All remaining characters on the line become part of the associated element string; if there are no remaining characters, the element is the empty string "". Once the raw character sequences constituting the key and element are identified, escape processing is performed as described above.

As an example, each of the following three lines specifies the key "Truth" and the associated element value "Beauty":

Truth = Beauty
Truth:Beauty
Truth :Beauty

As another example, the following three lines specify a single property:

fruits apple, banana, pear, \
cantaloupe, watermelon, \
kiwi, mango

The key is "fruits" and the associated element is:

"apple, banana, pear, cantaloupe, watermelon, kiwi, mango"

Note that a space appears before each \ so that a space will appear after each comma in the final result; the \, line terminator, and leading white space on the continuation line are merely discarded and are not replaced by one or more other characters.

As a third example, the line:

cheeses

specifies that the key is "cheeses" and the associated element is the empty string "".

Characters in keys and elements can be represented in escape sequences similar to those used for character and string literals (see sections 3.3 and 3.10.6 of The Java™ Language Specification). The differences from the character escape sequences and Unicode escapes used for characters and strings are:

* Octal escapes are not recognized.
* The character sequence \b does not represent a backspace character.
* The method does not treat a backslash character, \, before a non-valid escape character as an error; the backslash is silently dropped. For example, in a Java string the sequence "\z" would cause a compile time error. In contrast, this method silently drops the backslash. Therefore, this method treats the two character sequence "\b" as equivalent to the single character 'b'.
* Escapes are not necessary for single and double quotes; however, by the rule above, single and double quote characters preceded by a backslash still yield single and double quote characters, respectively.
* Only a single 'u' character is allowed in a Uniocde (sic) escape sequence.

Socracheese
Oct 20, 2008

im going to make a fortune by writing a framework that allows you to write lovely django knockoff frameworks quickly and easily

Nomnom Cookie
Aug 30, 2009



Soricidus posted:

Properties are processed in terms of lines. There are two kinds of line, natural lines and logical lines. A natural line is defined as a line of characters that is terminated either by a set of line terminator characters (\n or \r or \r\n) or by the end of the stream. A natural line may be either a blank line, a comment line, or hold all or some of a key-element pair. A logical line holds all the data of a key-element pair, which may be spread out across several adjacent natural lines by escaping the line terminator sequence with a backslash character \. Note that a comment line cannot be extended in this manner; every natural line that is a comment must have its own comment indicator, as described below. Lines are read from input until the end of the stream is reached.

A natural line that contains only white space characters is considered blank and is ignored. A comment line has an ASCII '#' or '!' as its first non-white space character; comment lines are also ignored and do not encode key-element information. In addition to line terminators, this format considers the characters space (' ', '\u0020'), tab ('\t', '\u0009'), and form feed ('\f', '\u000C') to be white space.

If a logical line is spread across several natural lines, the backslash escaping the line terminator sequence, the line terminator sequence, and any white space at the start of the following line have no affect on the key or element values. The remainder of the discussion of key and element parsing (when loading) will assume all the characters constituting the key and element appear on a single natural line after line continuation characters have been removed. Note that it is not sufficient to only examine the character preceding a line terminator sequence to decide if the line terminator is escaped; there must be an odd number of contiguous backslashes for the line terminator to be escaped. Since the input is processed from left to right, a non-zero even number of 2n contiguous backslashes before a line terminator (or elsewhere) encodes n backslashes after escape processing.

The key contains all of the characters in the line starting with the first non-white space character and up to, but not including, the first unescaped '=', ':', or white space character other than a line terminator. All of these key termination characters may be included in the key by escaping them with a preceding backslash character; for example,

\:\=

would be the two-character key ":=". Line terminator characters can be included using \r and \n escape sequences. Any white space after the key is skipped; if the first non-white space character after the key is '=' or ':', then it is ignored and any white space characters after it are also skipped. All remaining characters on the line become part of the associated element string; if there are no remaining characters, the element is the empty string "". Once the raw character sequences constituting the key and element are identified, escape processing is performed as described above.

As an example, each of the following three lines specifies the key "Truth" and the associated element value "Beauty":

Truth = Beauty
Truth:Beauty
Truth :Beauty

As another example, the following three lines specify a single property:

fruits apple, banana, pear, \
cantaloupe, watermelon, \
kiwi, mango

The key is "fruits" and the associated element is:

"apple, banana, pear, cantaloupe, watermelon, kiwi, mango"

Note that a space appears before each \ so that a space will appear after each comma in the final result; the \, line terminator, and leading white space on the continuation line are merely discarded and are not replaced by one or more other characters.

As a third example, the line:

cheeses

specifies that the key is "cheeses" and the associated element is the empty string "".

Characters in keys and elements can be represented in escape sequences similar to those used for character and string literals (see sections 3.3 and 3.10.6 of The Java™ Language Specification). The differences from the character escape sequences and Unicode escapes used for characters and strings are:

* Octal escapes are not recognized.
* The character sequence \b does not represent a backspace character.
* The method does not treat a backslash character, \, before a non-valid escape character as an error; the backslash is silently dropped. For example, in a Java string the sequence "\z" would cause a compile time error. In contrast, this method silently drops the backslash. Therefore, this method treats the two character sequence "\b" as equivalent to the single character 'b'.
* Escapes are not necessary for single and double quotes; however, by the rule above, single and double quote characters preceded by a backslash still yield single and double quote characters, respectively.
* Only a single 'u' character is allowed in a Uniocde (sic) escape sequence.

Json is the same poo poo just poorly specified. Never trust a spec less than 50 pages long--the subject is either so tiny as to be useless or woefully underspecified, usually the latter

double sulk
Jul 2, 2010

markerstore posted:

it won't even be that

think it'll be dead that fast? docker is actually a cool thing written in go imo

Soricidus
Oct 21, 2010
freedom-hating statist shill
i maintain a program that uses java properties files for its data, and users keep trying to edit them by hand or generate them from scripts and they always get it wrong. always.

basically gently caress users use xml

Nomnom Cookie
Aug 30, 2009



Soricidus posted:

gently caress users

X-BUM-RAIDER-X
May 7, 2008
the users arent the problem, its the computers that are terrible

abraham linksys
Sep 6, 2010

:darksouls:

Notorious b.s.d. posted:

like golang, in five years it will be totally forgotten but still widely-deployed inside google

go will live on for a while i think, there's nothing keeping it from continuing to exist as a more friendly c alternative, and as more and more programmers opt to skip learning c/++ it will become more popular

meanwhile dart is literally already dead, google's entire front-end situation is a trainwreck between
  • web toolkit (lovely, dead)
  • closure compiler/tools (dead except for compiler's use in clojurescript)
  • angular (thriving, probably going to stick around for a while)
  • polymer (experimental/toy, adoption doubtful)
  • dart (i literally forgot it existed until someone brought it up in this thread!)
ironically microsoft of all people have had a pretty popular javascript variant called typescript (that's exactly what it sounds like), whereas google can't seem to get their poo poo together at all outside of angular

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


tbh i hope rust fills that role instead of go.

spongeh
Mar 22, 2009

BREADAGRAM OF PROTECTION
angular started off as a non-google project, the guy just worked for google. i'm not really sure how much involvement other google employees has, but otherwise agreed. i don't think it's really used internally there.

typescript isn't very popular when you compare it to coffeescript, but it seems to be well maintained.

Posting Principle
Dec 10, 2011

by Ralp
go is for replacing plangs, not c

Vanadium
Jan 8, 2005

Condiv posted:

tbh i hope rust fills that role instead of go.

I'm really amazed the rust people get anything done with how sadistic their type system is.

I don't really see anyone picking up rust that isn't a C++ veteran who needs rust's pointer lifetime/mutability errors to get off because C++'s template errors don't do it for them anymore.

Vanadium
Jan 8, 2005

I'm really digging their logo though!

rsjr
Nov 2, 2002

yay for protoss being so simple that retards can win with it
google is gonna give front-end devs the best of both worlds. angularjs in dart https://github.com/angular/angular.dart

Police Academy III
Nov 4, 2011

Vanadium posted:

I'm really amazed the rust people get anything done with how sadistic their type system is.

I don't really see anyone picking up rust that isn't a C++ veteran who needs rust's pointer lifetime/mutability errors to get off because C++'s template errors don't do it for them anymore.

i like rust because it seems like they're trying to tackle problems that no-one else wants to deal with, but gently caress me if trying to use it didn't make me want to tear my hair out.

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


Vanadium posted:

I'm really amazed the rust people get anything done with how sadistic their type system is.

I don't really see anyone picking up rust that isn't a C++ veteran who needs rust's pointer lifetime/mutability errors to get off because C++'s template errors don't do it for them anymore.

last time I used it, rust seemed like your average strongly typed language. which is good, gently caress c and c++'s middling type strength.

also, as an absolute beginner to the language, pointers were kind of tough for me (mainly because the program I wrote exposed like 6 compiler bugs), but not anything like the template errors in C++

X-BUM-RAIDER-X
May 7, 2008
on the other hand, C++ owns

unixbeard
Dec 29, 2004

C++ is probably pretty cool if you've never used anything but C++

X-BUM-RAIDER-X
May 7, 2008
yeah you're right

C++ and perl. all u need.

Zlodo
Nov 25, 2006

unixbeard posted:

C++ is probably pretty cool if you've never used anything but C++

I used basic assembler c c++ c# lua and javascript and i think c++ owns hth

Zlodo
Nov 25, 2006
oh I also used python but its so awful that I'm unconsciously blocking those memories apparently

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


Zlodo posted:

I used basic assembler c c++ c# lua and javascript and i think c++ owns hth

you think c++ is better than c#? i can understand liking it over the others in that list, but c# is awesome

also, i would think javascript is a more scarring experience than python

prefect
Sep 11, 2001

No one, Woodhouse.
No one.




Dead Man’s Band

OBAMA BIN LinkedIn posted:

so what's the ironic yospos take on parsing .ini style key value stores?

is there a perl dbd module for ini files? (i love perl's dbi/dbd stuff :allears:)

Adbot
ADBOT LOVES YOU

X-BUM-RAIDER-X
May 7, 2008

prefect posted:

is there a perl dbd module for ini files? (i love perl's dbi/dbd stuff :allears:)

no but Config::Tiny rules

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