YAML

Is JSON on suicide watch?

Attached: image001.png (432x449, 40K)

Other urls found in this thread:

justi.cz/security/2017/10/07/rubygems-org-rce.html
seriot.ch/parsing_json.php
twitter.com/NSFWRedditGif

nobody reads JSON like a book, and even then there are prettifiers. This looks like json just with some replaced characters.

A binary format significantly reducing transfer sizes is a more promising replacement.

we are a protobuf shop though

>Forced indentation
I bet you also like python, fag.

Yeah, I like it a lot. I've convinced almost everyone except some really oldschool boomers to drop MATLAB in favor numpy+scipy.

>binary formats for data that needs to be human-readable

But MATLAB is such a better language.
Simply the fact that its array indices start at 1 makes it a superior language.
It's actually incredible how much pain it cost me to reproduce some MATLAB code in python, it really shows that MATLAB was made for these things and python not.

Attached: hqdefault.jpg (480x360, 32K)

>syntactic whitespace

Attached: 1470762119661.jpg (882x439, 90K)

I am 100% serious and if you don't believe me actually try writing equivalent programs in Python and MATLAB.

The fact alone that in scipy matrix x matrix requires some function, instead of being simply what you expect it to be, namely * shows that it is simply not as well suited for being used.

YAML is harmful and easily exploitable. Use JSON for all data from now on.

justi.cz/security/2017/10/07/rubygems-org-rce.html

this is entirely possible you gigantic mongoloid. Just because it can't be directly printed to a console doesn't mean it can't be turned into human-readable data

YAML is fucking garbage. It's syntax is unnecessarily convoluted for what should be simple. It's like crawled through every post on the internet which was "I wish you could do X in JSON" and then added all those features to something.

If JSON:
1. Allowed trailing commas
2. Allowed comments

It would be literally perfect.

>Using racist terminology

>comparing YAML to json
are you retarded?

Still better than a cumdumbster called XML.

There's nothing really different about it compared to JSON except the semicolons and braces are replaced with forced indentation.

but what about tom's obvious minimal language?

Attached: 49118824.jpg (488x488, 22K)

When does the multiline comment end?
How vulnerable would this be against injection?

back to Jow Forums you go

>yaml 1mb
>json 100kb
fuck off with your bloat

Library writers can't even write correct JSON parsers. YAML is like a hundred times more complex.

seriot.ch/parsing_json.php

Also the core schema is not integral part of the YAML 1.2 spec. Many libraries try to implement the core schema but fail miserably. I had problems with libraries emitting inf (which should be ".inf", ".Inf" or ".INF" according to the spec), or interpreting TrUe as bool on input (only "true", "True" and "TRUE" are allowed).

Not with that cringe markup.

What? Why would you need JSON parsers? You can just read it like it is unless you're a brainlet.
Infinitely better than XML. Don't know any other formats.

Fuck off poettering

>1. Allowed trailing commas
tfw you're so autistic, that even if something allows trailing commas you remove them because this triggers your ocd

MATLAB is a great calculator and a horrible general purpose programming language (which you can argue that it isn't one).

>a horrible general purpose programming language
No denying that. It's string handling is awful.
But for calculating things it is really good.

Trailing commas are great if you separate values line by line.
[
"apple",
"orange",
"lime",
]

This way all lines are similar and you don't have to go edit the commas at line endings if you put something at the very end or remove the last element.

wait, j(a)son really doesn't allow for trailing comas? why would they do that

I use C++ and the Arduino library for calculating things. I get the speed benefit, plus the syntax is not much more verbose than MATLAB's. They actually overload operator* to do matrix multiplication.

>Indices starting at 1
0 starting indices grow on you if you start using it. It's way better.

One example: let's say you flatten an nxn matrix to a n^2 long vector. You want the positon in the vector that were originally on ith row and jth column in the matrix.
with 0 starting index: pos = i + n * j
with 1 starting index: pos = i + n * (j - 1)

With 1 starting index usually there are way more +-1 modifiers than with 0 starting index.

The same argument can be made for python's left inclusive ranges.

I don't know. Allowing an optional trailing comma makes it a little bit more complex, but not very much.

Attached: array.gif (598x113, 4K)

>Arduino library
What the fuck?
I seriously doubt that they have such a wide library of numerical algorithms, especially when it comes to iterative solvers, vpa, symbolic and sparse computations.

>C++
Why wouldn't you use an interpreted language?
The heavy lifting is all in C++ anyway, even when using MATLAB.

>It's way better.
Not if you are trying to implement mathematical algorithms.

>let's say you flatten an nxn matrix to a n^2 long vector
help reshape
Thats why I use MATLAB, it's already implemented.

>with 1 starting index: pos = i + n * (j - 1)
And numerous counter examples exist.
It just so happens that ALL mathematical descriptions of algorithms start with 1.

>A binary format significantly reducing transfer sizes is a more promising replacement.
this
computers are so easy nowadays we need a good binary format so we can start wrangling with endianness and word sizes again

>justi.cz/security/2017/10/07/rubygems-org-rce.html
just don't write a program that automatically serializes yaml. take the values and bind them to variables yourself.

>micromanage the shit out of simple serialization because the format sucks
thanks, I'll pass
better yet, I'll chose a different format

> (You)
>>Arduino
Fuck, I meant Armadillo.
>I seriously doubt that they have such a wide library of numerical algorithms, especially when it comes to iterative solvers, vpa, symbolic and sparse computations.
>>C++
>Why wouldn't you use an interpreted language?
>The heavy lifting is all in C++ anyway, even when using MATLAB.

Because my computations require dynamic allocation and I can't preallocate, as the size is not known beforehand. MATLAB sucks dick at this. Not any of MATLAB's facilities help my simulations.

>numerical algorithms, iterative solvers
Boost's integral solvers are fine. Now it's a bit more convoluted than MATLAB's though.

>vpa
There are C (and maybe C++) libraries for that, never had to use them.

>sparse matrices
Armadillo has them

>symbolic
Never searched for a C++ symbolic computation library. I use Mathematica for that. Also I use Mathlink to combine the two.

>Fuck, I meant Armadillo.
Okay, that explains a lot.

yaml confirmed for jewish conspiracy

>You can just read it like it is
what

I met toml and can't move away from it.

Yep stopped giving a shit right here. JSON wins by pure simplicity alone. You can write a parser in an afternoon from spec. The only things you need to worry about are objects, arrays and basic value types. That's it. No memes required on the wire. Your API servers and clients can work out the type coercion. Its not a big fucking deal. We do it all the time without issues today. Check out newtonsoft JSON serializer if you want to see how the big boys do it.

>indentation based syntax

This is a horrible replacement to JSON. JSON isn't meant to be read by humans, JSON can be compacted to lessen how much the amount of data you have to download.

Writing in useless whitespace and tabs is literally retarded.

R + dplyr is better than any disgusting Python trash.

Whitespace sensitivity makes it unsuited for data transfer. For config files it's OK imo.

>matlab
>good for mathematical algorithms
Even simple things like arbitrary precision integers and fractions use a fucking symbolic toolbox and are represented as strings. Sane implementation is cumbersome to build because of language limitations. Also, for some reason it only has finite fields of order 2 built-in.
Topics other than algebra are similarly difficult: combinatorial objects, geometries, languages, etc. are just very difficult to implement and use in Matlab.
All of these things typically take only a couple of lines to properly implement in C++ or similar languages, and D/newer C++ versions even allow you to factorise some polynomials at compile time.

>Even simple things like arbitrary precision integers and fractions use a fucking symbolic toolbox
So what??

>and are represented as strings
???
You mean internally?
I have doubts about that, but I don't know.
At least the results aren't strings.

>Sane implementation
Yeah, but not fast one.

>Also, for some reason it only has finite fields of order 2 built-in.

>Topics other than algebra are similarly difficult: combinatorial objects, geometries, languages, etc. are just very difficult to implement and use in Matlab.
Might the language be called MATRIX laboratory?

>All of these things typically take only a couple of lines to properly implement in C++ or similar languages
I have implemented an arbitrary size integer type in MATLAB. But no, even multiplication of arbitrary integers is anything but trivial and you usually use more then one algorithm depending on the size of the number.

man htons

If the language is limited to matrices, and doesn't even handle matrices over arbitrary fields, then it's not a good language for mathematics in general.

>for loops just as slow as Python
FORTRAN or bust for calculation.

Python > FORTRAN > R >>>>>>>>>>> MATLAB

Does JSON have anchors and referencing like YAML? Same for TOML. It's the single most useful feature of YAML and allows for really succinct and human-readable descriptions that you can plug into autogen tools.

The fucking shapes though.
(n,) when I want obviously (n,1)
Plus you have to copy matrices manually and so on...
If I wanted to do a lot of typing anyways I'd use the blas library directly
Matlab is technically superior and its documentation is reference textbook tier.
But it's closed source so shame on that. So much more that many people paying for matlab are paying for the support, and I bet universities would still get matlab licences regardless I guess.
I really want to look under the skirt of some libraries.

Every JSON is also a valid YAML since it's a superset. Technically you're always using YAML.

Can someone give me the quick rundown on YAML? I'm supposed to be implementing YAML for layout data.

Unironically used YAML in a work project the other week, what I found is that basically no libraries or online validators agree on what is valid or invalid YAML. It's a fucking mess and to get anything to work you need to use lowest common denominator syntax.

YAML is UGLY. UGLY!

>then it's not a good language for mathematics in general.
Sure, I thought that was obvious from the name.
It is supposed to do numerics.

> being a brainlet

>not using Julia

edn tho.

> JSON isn't meant to be read by humans
> JavaScript Object Notation
It literally was designed to read and written by programmers.

samenigger