Fork me on GitHub
#other-languages
<
2021-12-24
>
emccue08:12:22

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

emccue08:12:15

hard work left is parsing symbols, numbers, and strings

emccue08:12:22

which i am probably out of my depth for

borkdude08:12:49

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

borkdude15:12:37

@emccue Is this repository public somewhere?

borkdude15:12:48

Or is this all the code?

emccue16:12:07

No, but it can be

emccue16:12:33

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

borkdude16:12:51

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

borkdude16:12:58

or whatever Rust calls them, traits

emccue16:12:27

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"

emccue16:12:16

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

emccue16:12:36

(some are extra)

borkdude16:12:23

what about:

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

emccue16:12:23

and then delete the top 2 lines

emccue16:12:44

that is there on line 112

emccue16:12:06

actually let me send you where i got by 4am

emccue16:12:30

updated the gist

borkdude16:12:38

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

emccue16:12:49

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

emccue16:12:59

but ultimately i was just noodling on this

emccue16:12:11

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
borkdude16:12:32

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

borkdude16:12:38

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

borkdude16:12:56

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

emccue16:12:49

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

borkdude16:12:26

similar to what datalevin is doing I think now

emccue16:12:36

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

emccue16:12:00

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

emccue17:12:26

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

emccue17:12:41

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

emccue17:12:46

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

emccue17:12:21

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

emccue18:12:29

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" }
['"']

emccue18:12:08

im having fun at least