Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
@iamavalos Thanks! Super soon on the source.
And yah I thought it fit there but I'm afraid to use the actual rant category these days.
Fuck some of the hardass users here XD -
@FrodoSwaggins Now that I'm in the parsing mood, I might do YAML.
For sure, not XML though. That seems a little hard.
CSS Maybe. Like a simple CSS parser. None of that like... :nth-child(3) shit -
@iamavalos It seems that way, more and more. Originally we just hated on people that posted facebook memes, which, is mean, but IMO, a little justified. Now you get crucified if you mislabel your most.
I'm just gonna quickly write the Lua -> JSON (Stringifier) and then I'll update the GH repo and mention you. Probably won't make another post about it here. -
@iamavalos That's true, and it shouldn't be that way.
People are abrasive online no matter what, I have found. -
@SauceBoss There's OOP, but it isn't fully-featured OOP.
Its actually better than the JS OOP, especially if you learn how to work the metatables (Which allows you to do operator overloading.
The syntax is definitely... unique, however. Quite a bit different from how you'd do OOP in other languages. The ":" operator is definitely confusing.
Have a look,
https://www.lua.org/pil/16.1.html -
@SauceBoss The syntax really is great, it reminds me of SQL, but somehow better.
ES6 (Actual classes and inheritance within the syntax) makes OOP in JS a bit nicer but I still prefer Lua as a language -
@SauceBoss Lua itself is still pretty high level, arguably higher level than PHP.
But when you get to working with c/c++ AND Lua together (Which isn't required, by the way. Just very common), you'll learn about some pretty low-level items like pointers and stack machines. That's where the fun really is. Buyer beware, it's also where the headaches live. -
@SauceBoss At the moment, I'm working on expanding the Lua standard library. I want to make it comparable to the Python or even Java std lib.
Most of the things I have actually done with Lua in the past have been in Minecraft because of the Computer Craft mod, which is what introduced me to Lua -
@SauceBoss It doesn't have a standard one, like npm or pip, but there's one that is pretty much de-facto, and it has the best name of any package manager:
luarocks
It gets even better knowing Lua is Brazilian Spanish for moon. It's a double pun. -
@FrodoSwaggins (I assume, quite luckily) I have never worked with YAML past some very basic data, so I do not know the horrors.
I'd actually be interested in hearing some, to be honest. I might be up for the challenge. I'm on a high after completing this. -
lxmcf199506yAs 'easy' as JSON parsers are, fuck me they are fun to build.
Does your parser support .JSONC or just JSON? -
@lxmcf I would probably work comment ignoring into the code pretty easily. I'll do it later tonight and let you know how it goes. I also want to optimize it by using string.byte instead of 1-length substrings.
-
-
Really interesting! We (as in a coding dojo) made one in Ruby yesterday. The idea was being able to parse a stream of JSON, for exemple a very large file. Code available here: https://gitlab.com/epfl-dojo/...
-
@AlgoRythm well, the main idea is here, it was a one hour dojo so there is still a lot to do for a usable thing. But we learn the way to stream parse and it was the point !
-
@ponsfrilus Aha, very nice! I don't know Ruby, but after starting at the code for a bit it didn't seem like it actually returned any data, but I thought that perhaps it was just some Ruby magic I didn't understand.
It does look pretty good though. -
@AlgoRythm check this out http://seriot.ch/parsing_json.php (found via HN - https://arp242.net/weblog/...). It might be relevant for you.
Related Rants
I'M SO PROUD, I WROTE A FULLY-FUNCTIONAL JSON PARSER!
I used some data from the devRant API to test it :D
(There's a lot of useful tests in the devRant API like empty arrays, mixed arrays and objects, and nested objects)
Here's the devRant feed with one rant, parsed by Lua!
You can see the type of data (automatically parsed) before the name of the data, and you can see nested data represented by indentation.
The whole thing is about 200 lines of code, and as far as I can tell, is fully-featured.
random
devrant
json
lua