These are chat archives for synrc/n2o

18th
Jul 2018
Namdak Tonpa
@5HT
Jul 18 2018 00:56
When you will finish, let me know I will compactify the code a bit, or you may do this as well.
Try to be as compact as possible as we are precisely tuned per byte transfer per included js file.
Just make sure this is minimal readable js with single-character variables, etc.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 00:59
Alright, I'll look into it. I've come to rely on Webpack these days which does all of this already, so I generally keep my code as verbose as possible.
Namdak Tonpa
@5HT
Jul 18 2018 00:59
You may educate yourself with code style used in existed files.
The js style in N2O is hand coded only. It can't be produced by robots. This is pure ASCII art :-)
Turing Test.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:00
Ah, but of course.
Namdak Tonpa
@5HT
Jul 18 2018 01:01
It should be Idiotically minimal, yet complete functional.
At most 3 MSS size during TCP transfer.
Per whole js pack.
Top noch quality requested!
You can write article after that (if you wish) I will publish it on http://n2o.space
Or you can describe even whole n2o js companion library :-)
Only if you have infinite time!
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:05
Haha yeah, the time is at question.
Namdak Tonpa
@5HT
Jul 18 2018 01:06
Ask anything I will help.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:06
I've taken on a task to rewrite the whole n2o framework (front and backends) applying my own coding philosophies, and addressing things that in my view are issues. I'll see how it goes.
And thanks! I'll keep that in mind.
Namdak Tonpa
@5HT
Jul 18 2018 01:07
Ah, that's ok for me!
I outlive several forks :-)
Feel free to rewrite it!
The More N2O, The Better! N2O is not a product this an idea of purity and canonicity.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:08
I am rebuilding it from ground up, so I doubt it'll ever become a fork. And absolutely - I loved the idea, and so I decided to apply a personal touch. I'll likely be using it for my own company.
Namdak Tonpa
@5HT
Jul 18 2018 01:09
Like example of minimal viability.
One may call it "poor man" software.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:10
A pretty funny name, given that it outdoes major frameworks at what it already does.
Namdak Tonpa
@5HT
Jul 18 2018 01:10
If you'll get this idea into your mind-stream you'll discover true happiness in hacking!
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:10
mhm
Namdak Tonpa
@5HT
Jul 18 2018 01:11
Canonicity means that you can't reduce that code anymore or compact it in any way.
Almost all subroutines should be presented in normal forms.
That's the basement N2O was built on.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:13
I see. A very solid basement.
Namdak Tonpa
@5HT
Jul 18 2018 01:13
N2O is not an Erlang application really. N2O should be distributed as an Erlang modules or JS single files.
Like HTML pages, or Groff manuals.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:15
N2O is a way of thinking :)
Namdak Tonpa
@5HT
Jul 18 2018 01:15
Please make you evolution compatible in some way to be able to mix files from two distribution.

N2O is a way of thinking :)

Exactly, N2O can be implemented in any language.

We have Haskell version.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:17
Oh yeah I've seen the Haskell version, but I hate Haskell - it's too pure for me haha
Namdak Tonpa
@5HT
Jul 18 2018 01:17
Each language put it's own shaping to codebase, so they are really should be very different.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:17
Perhaps someone should implementing N2O in C :^)
Namdak Tonpa
@5HT
Jul 18 2018 01:17
What do you think about N2O binary protocol compatibility ?
Or you want to redesign this layer too ?
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:18
I like the idea of it. It's cleaner than any other commonly used formatter.
the only things I would change is maybe add more types at front end?
Also make the API more friendly.
Namdak Tonpa
@5HT
Jul 18 2018 01:19
do you mean n2o_proto ?
I can try to build formal model :-)
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:19
I mean the js files. n2o_proto does raise a few concerns too though
Namdak Tonpa
@5HT
Jul 18 2018 01:19
then rewrite my layer too!
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:20
My main concern is that it allows unpresidented bidirectional messaging.
It's a plus, in terms of flexibility
Namdak Tonpa
@5HT
Jul 18 2018 01:20
it includes filters
filters and protocols could override everything
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:20
but if say the client figures out how to send {flush, Data} or something like that
they could potentially spam the server
Namdak Tonpa
@5HT
Jul 18 2018 01:20
ah, ... meh
n2o_nitro is used in one place :-)
this is not hipster technology
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:21
of course
Namdak Tonpa
@5HT
Jul 18 2018 01:21
n2o_nitro is not a part of n2o anymore
this is synrc/nitro repository
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:22
Yup, I've noticed that
Namdak Tonpa
@5HT
Jul 18 2018 01:22
n2o_nitro is a layer sitting in repo (like I said distribution copy)
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:22
though some code in n2o still relies on nitro I believe, but I guess that'll be fixed with time
Namdak Tonpa
@5HT
Jul 18 2018 01:22
Let me know about some architectural glitches you may find during recreation.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:22
Will do
Namdak Tonpa
@5HT
Jul 18 2018 01:22
I would be happy to apply fixes immediately.
no
n2o code in no way rely on nitro.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:23
I stand corrected then
Namdak Tonpa
@5HT
Jul 18 2018 01:23
it is totally purified in synrc/mqtt, the latest version of N2O, 4.6
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:23
Ah, noted
Namdak Tonpa
@5HT
Jul 18 2018 01:24
N2O 4.5 — is new MQTT era, with new community site n2o.space
N2O 4.4 — is an old N2O with PDF book and synrc.com site
Make sure you recreate latest version :-)
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:25
Thank you for clarifying, I'll pay attention
Namdak Tonpa
@5HT
Jul 18 2018 01:26
Thank you for paying attention to N2O, I bet you'll find happiness!
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:26
haha any day :)
Namdak Tonpa
@5HT
Jul 18 2018 01:27
N2O-MQTT now powers this https://www.nynja.io JFYI
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:28
Hoh, very interesting
Namdak Tonpa
@5HT
Jul 18 2018 01:28
This is how I structured the protocol https://github.com/NYNJA-MC/protocol
I have client generators to JavaScript and Swift: https://github.com/synrc/bert
It uses parse transform to access Erlang AST Types during compilation and produces Encoders and Decoders for native language usage.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:31
I see
Namdak Tonpa
@5HT
Jul 18 2018 01:31
This is how BERT protocol looks like in JS
        {tup: 'io', code: 'login', data: {tup: '$', 0: 'Auth', 1: 12}},
        {tup: 'io', code: 'login', data: {tup: 'Auth'}},
        {tup: 'io', code: 'login', data: {tup: '$', 0: 'doe', 1: 12}},
        {tup: 'Roster', userlist: [{tup: 'Contact'}], status: 'get'},
        {tup: 'p2p', from: 'john', to: 'doe'},
        {tup: 'Profile', accounts: [1], status: 'maxim'}
It supports named (typed) records and anonymous tuples as well as sum types.
Hope you'll find this interesting to you as well.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:35
Thanks, I've got a lot of studying to do :)
Namdak Tonpa
@5HT
Jul 18 2018 01:35
now you see how far we from {flush,_}? :-)
Actually even if client will figure out how to send {flush,_} (disclaimer: not I invented this mechanism anyway), the only thing client can do is to kill its session.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:39
Hmm, that's true
Namdak Tonpa
@5HT
Jul 18 2018 01:39
You forgot that clients are totally isolated by cookie namespace (AUTH).
We passed audit for Banks. Be cool.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:40
That's awesome
Namdak Tonpa
@5HT
Jul 18 2018 01:41
n2o_secret was reviewed by two security officers independently and one error was found and fixed (git history).
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:42
was it fixed in mqqt? or earlier N2O
Namdak Tonpa
@5HT
Jul 18 2018 01:42
Any N2O is top noch quality.
just N2O-MQTT is a cutted is some sense version.
But contains a bridge for MQTT broker client.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:43
Ah well, I was just wondering where to look for the changes, as I am trying to dive into security myself.
Namdak Tonpa
@5HT
Jul 18 2018 01:44
Next version 5.0 or 6.0 should be merged both lineages.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:44
I see, looking forward to it :)
Namdak Tonpa
@5HT
Jul 18 2018 01:48
First finish your rewrite! Maybe I'll switch yours.
Genetic Diversity!
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 01:49
Or maybe vise-versa; I am pretty new to this - so we'll see how it goes.
Conrad Steenberg
@hengestone
Jul 18 2018 02:05
Side comment: using protobuf on the client and server is very convenient vs BERT since the de/serialization code gets generated automatically and it's relatively well-supported
Namdak Tonpa
@5HT
Jul 18 2018 02:06
Except its decoding on Erlang virtual machines decreases performance by 15%.
As XML does.
Conrad Steenberg
@hengestone
Jul 18 2018 02:07
yeah, the price of programmer convenience
Namdak Tonpa
@5HT
Jul 18 2018 02:08
We have generated clients.
It is supported by Synrc.
Pavel Kozlovsky
@thecynicalpaul
Jul 18 2018 02:08
I honestly think the fact that Erlang has its own External Term Format is a blessing
Namdak Tonpa
@5HT
Jul 18 2018 02:08
You can use GRPC protobuf.
In a couple weeks I will write protobuf generator for Erlang include files using synrc/bert library and parse transform.
Stay tuned.
Conrad Steenberg
@hengestone
Jul 18 2018 02:10
:+1:
Keep refreshing F5! :-)
or follow me on Github!
Conrad Steenberg
@hengestone
Jul 18 2018 02:11
I do already I think ;-)
Namdak Tonpa
@5HT
Jul 18 2018 02:11
Then this is super cool!
Any recommendations wishes on that task ?
There is one problem I found. After adding protobuf generator we can't use the name bert anymore :-)
synrc/proto ?
I really lost in names :-)
Conrad Steenberg
@hengestone
Jul 18 2018 02:18
My suggestion would be to have 2 lovely summer interns documenting the code and creating a nice web page for using it for us mere mortals :-P
Namdak Tonpa
@5HT
Jul 18 2018 02:18
isn't we have third item already ? nice site http://n2o.space as of N2O 4.9.3 BOOK?
this is what we called N2O CORE
why do you need 2 students here ?
tell me what is wrong with those pages and I will fix it.
Namdak Tonpa
@5HT
Jul 18 2018 02:25
Don't you happy with that guys ?
Conrad Steenberg
@hengestone
Jul 18 2018 02:28
Look at synrc/shen and compare it with hengestone/shen, src/shen.erl it would show the difference.
Your code is brilliant :)
But a little unnapproachable
Namdak Tonpa
@5HT
Jul 18 2018 02:30
come on guys, this is (trans)(com)-piler
it should be cryptic
Conrad Steenberg
@hengestone
Jul 18 2018 02:31
Have to run, ttyl :)
Namdak Tonpa
@5HT
Jul 18 2018 02:32
I just remind you that n2o has pretty decent site and fresh manual pages