other-languages 2021-12-24

none of the edn libraries for rust actually do the right things or close enough to change them to work

hard work left is parsing symbols, numbers, and strings

which i am probably out of my depth for

@emccue awesome! you can probably just "steal" the logic from tools.reader?

@emccue Is this repository public somewhere?

Or is this all the code?

No, but it can be

And for the edn parsing, yeah this is all the code

I tried to run it with Rust, but I think it's missing some classes

or whatever Rust calls them, traits

ux = "0.1.3"
uuid = { version = "0.8", features = ["v4"] }
num-bigint = "0.4.3"
bigdecimal = "0.3.0"
internship = "0.6.0"
thiserror = "1.0"
crc32fast = "1.3.0"
itertools = "0.10.3"
chrono = "0.4.19"

add these to the Cargo.toml file that comes with a blank project

(some are extra)

what about:

use crate::edn::ParserError::UnexpectedEndOfInput;

and then delete the top 2 lines

that is there on line 112

actually let me send you where i got by 4am

updated the gist

what's your goal with this, a concrete goal or just noodling?

well, publish a working edn library is an achievable thing at this point so that can be a real goal

but ultimately i was just noodling on this

and my thought was 1. This was/could be an open source datomic but there is no interest in the community for supporting it 2. rust is where I think all the database people hang out now 3. if i rewrote eva in rust it would more likely than not smoke everything in performance

👏 1

wasn't there also some datomic-like thing by mozilla written in rust?

if your EDN lib works well enough it could be used to send values over the wire with pods https://github.com/babashka/pod-registry I have a few of them written in Rust but they talk JSON currently

Ultimately transit is what I would like to have for every pod

yes, ish, but it wasn’t trying to be the same thing datomic is, it was a more embedded database. https://news.ycombinator.com/item?id=13568559

similar to what datalevin is doing I think now

actually now that im looking at it, they have an unpublished EDN module in there

https://github.com/mozilla/mentat/blob/master/edn/src/query.rs It seems to have a bunch of stuff for their query language in there too

disentangling that is probably just as much work as finishing this at this point

(though that would give better errors i’d wager)

also this would be a decent starting point for a transit library for rust - its the same final data model at the end of the day

i still have my “transit for elm” sitting there unfinished

Begin
['#', 'i', 'n', 's', 't', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

SelectingDispatch
['i', 'n', 's', 't', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

Begin
['i', 'n', 's', 't', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingSymbol { characters_before_a_slash: [], characters_after_a_slash: [], saw_slash: false }
['i', 'n', 's', 't', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingSymbol { characters_before_a_slash: ['i'], characters_after_a_slash: [], saw_slash: false }
['n', 's', 't', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingSymbol { characters_before_a_slash: ['i', 'n'], characters_after_a_slash: [], saw_slash: false }
['s', 't', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingSymbol { characters_before_a_slash: ['i', 'n', 's'], characters_after_a_slash: [], saw_slash: false }
['t', '"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingSymbol { characters_before_a_slash: ['i', 'n', 's', 't'], characters_after_a_slash: [], saw_slash: false }
['"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

Begin
['"', '1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "" }
['1', '9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1" }
['9', '8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "19" }
['8', '5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "198" }
['5', '-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985" }
['-', '0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-" }
['0', '4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-0" }
['4', '-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04" }
['-', '1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-" }
['1', '2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-1" }
['2', 'T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12" }
['T', '2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T" }
['2', '3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T2" }
['3', ':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23" }
[':', '2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:" }
['2', '0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:2" }
['0', ':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20" }
[':', '5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20:" }
['5', '0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20:5" }
['0', '.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20:50" }
['.', '5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20:50." }
['5', '2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20:50.5" }
['2', 'Z', '"']

ParsingString { built_up: "1985-04-12T23:20:50.52" }
['Z', '"']

ParsingString { built_up: "1985-04-12T23:20:50.52Z" }
['"']

im having fun at least