Fork me on GitHub
#off-topic
<
2018-09-21
>
borkdude07:09:21

> I don’t care about static or dynamic types, nor about FP, LP, or OO. For me, they are overly complex, unreliable, and unscientific. I think they are very bad and upset me. Don’t know what that’s about but it made me laugh 🙂 https://clojureverse.org/t/why-do-you-prefer-clojure-over-haskell/1967/70?u=borkdude

😕 4
john14:09:24

I like that dude's enthusiasm 🙂

sveri08:09:55

I've have seen him respond to threads a few times and always was kind of confused about what he wants to say actually. I still dont know what to make of it: https://github.com/linpengcheng/PurefunctionPipelineDataflow is a mix of chinese (I suppose) and english statements and citings https://github.com/linpengcheng/fa is the homepage for the "...largest personal Clojure project in the world." but without any actual code and 63 commits to the readme and which leads to nowhere but two downloads of executables which could as well be trojans? Also why are types unscientific?

sveri09:09:02

That said, viewing programming from a different angle sounds interesting. The endless "war" about static vs dynamic typing is time consuming at best, dangerous at worst and leads to nowhere in my opinion. Also it doesnt matter outside the programmers world. Maybe we as a programmer, should take a step to the side and consider a different view about programming?

sveri09:09:10

Well, maybe not, but its fun to think about.

Denis G11:09:42

Is Lisp (and therefore Clojure as well) a multi-stage programming language?

Denis G11:09:57

runtime code gen is possible due to quotations and executing that code is possible due to eval, right

orestis14:09:34

Yes, @denisgrebennicov that sounds about right to me.

orestis14:09:27

(def a (list + 1 2))
(eval a)
; 3

orestis14:09:26

But most people will just do macros instead.

danielstockton14:09:11

"Multi-stage programming languages support constructs similar to the Lisp construct of quotation and eval, except that scoping rules are taken into account."

borkdude14:09:56

isn’t this what the keynote talk on EuroClojure 2017 was about?

Denis G15:09:09

@orestis macros are compile-time. Multi-stage allows codegen at runtime depending on the input, different function as a result

Denis G15:09:41

perfect. Since I am using Terra (http://terralang.org) for db query compiler backend 😄 She has exactly the same topic. 's gonna be an interesting watch. Thanks

orestis16:09:41

@denisgrebennicov ah, right, of course. I’d be interested to hear your use case for generating code at runtime.

orestis16:09:26

The same speaker gave a keynote at clojutre btw.

Denis G16:09:12

query compilation. The idea is the you get a query at runtime. For that query you don't want to run typical iterative approach. Representing every relational algebra operator as an Iterator. Rather you generate code exactly for that query. Which yield to better performance. At our database chair we compile queries into LLVM IR and then bind it to the main process and execute the code. But generating LLVM IR code is ain't no fun. I've used Terra for writing high-level concepts and it yielded LLVM code, which is very nice 😄

orestis16:09:44

Ok wow that sounds crazy but if you got results out of it...

Denis G16:09:48

@orestis E.g. for query SELECT * FROM users WHERE surname = "BLABLABLA" Generated code should be like

for user in users:
    if user.surname = "BLABLABLA":
        yield user
Here you win in cache efficiency, less method dispatching (no virtual methods) etc really "low level" stuff

orestis16:09:27

Right so you have to have the data already in memory right?

Denis G16:09:41

it is for in-memory db

orestis16:09:47

That is, we are not talking about interfacing with an external database in the traditional sense.

Denis G16:09:15

in case you are interested: http://www.vldb.org/pvldb/vol4/p539-neumann.pdf actually CMU has an advance db lecture where they say that compiling to LLVM is actually pretty sweet and now a lot of people do it. At CMU as well

Denis G16:09:35

SQL database with all its data in RAM

Denis G16:09:45

same SQL support, same transacations, everything is same

lemontea15:09:09

on a (very tangent) tangent I have been looking into various CS-fundamentals subjects, at time even crossing the software/hardware boundary. (partially to fill relatively major gaps in my education, partially “for culture” ) One surprising thing I’ve learnt is more on the altitude side - don’t just passively watch it, question the assumptions. Most of the time you just end up understanding thing more deeply. Occasionally you hit up on a possible, new alternative. So there you go, in-memory DB (okay, I’m many years late, but whatever) </end rant>

lemontea15:09:13

oh, on another tangent I wouldn’t dismiss “theoretical question” so quickly - afterall Lisp started by “confusing theory with practice” - John McCarthy and all that

Denis G06:09:45

They dive deep into topics like codegen. how to handle concurrent transaction executing, etc. (MVCC) Not your plain lets learn SQL course

lemontea06:09:44

thanks! I’ve taken a DB course in uni - it did covered the usual theory topics like relational algebra, indexing data struct, query execution, transaction and journaling etc - so I think I’m supposed to look at more advanced topic to make further progress (e.g. distributed DB, like consistent hashing, chord, distributed consensus (on this point I liked the Raft algo) )…

Denis G06:09:47

I don’t think at uni you covered MVCC, or Codegen, Query Optimizers, etc.

Denis G06:09:06

This course is advanced DB course. Not DB 101

lemontea06:09:17

I’m open to revisiting the “classics” if there are fresh perspectives/new advances. Besides I’ll admit I don’t grasp the last part of that course very well (transaction theory, 2PL, those transaction graphs, etc)

lemontea06:09:49

oh this is the advanced one? didn’t notice that in the title:sweat_smile:

Denis G06:09:26

wait, maybe I’ve sent the wrong link

Denis G06:09:38

here you go

lemontea06:09:07

btw, perhaps immature to ask at this point, what’s gonna happen to the classical transaction theory in light of MVCC?

lemontea06:09:46

would it become obsolete? or just revised to coexist with MVCC, or even get integrated?

Denis G06:09:36

classical transaction theory is more pessimistic (AFAIK). Locking everything for every transaction. MVCC is optimistic. So you will know more things 😄

Denis G06:09:51

there is some timestamp idea. A friend of mine was telling it to me. Already forgot 😅 BUt there are 2 lectures on this topic. Pretty sweet

lemontea06:09:02

ya, now that you mention it I rmb now…still sleepy here (always, 24/7) thanks~

lemontea06:09:41

very pretty pictures to make intimidating topics look not-so-intimidating

lemontea06:09:14

even though the link should be obvious/easy to find: https://raft.github.io/

Denis G08:09:27

thanks for the link! Helps a lot I am a student and mobile dev and transitioning to backend, therefore those scalability blogs and infos are very appreciated. Thanks!

Denis G08:09:15

BTW isn't raft thingy, like a watchdog on something else. I though there was like a heartbeat algorithm?

Denis G08:09:10

I guess I don't know shit, so I gonna be reading 😄 Thanks 😉

lemontea08:09:09

Raft is an alternative to Paxos, which is the “standard” (or should I say “academic” ) version of doing distributed consensus

lemontea08:09:55

Because Paxos is notoriously hard to understand or poke correctly

Denis G08:09:49

Gonna have distributed systems lesson this semester. Hope learning stuff like this 😅

lemontea08:09:58

tl;dr: Raft simplify the problem by doing leader election to centralize. Then a simple quorum at a strategic location in the algo is good enough

lemontea08:09:36

they also claim for real-world/industry implementation Raft is a closer match with reality/how it is actually done

lemontea08:09:31

good luck! distributed system is a pretty tough course if you don’t have the right mindset

Denis G08:09:15

Are you in academia? studying? Or learning things just for fun?

lemontea08:09:32

my experience is that a 2/3 mathematician, trust nothing but the proof + 1/3 pragmatic, intuition guided approach work best

lemontea08:09:25

self-study, I don’t work to be stuck being a code-monkey with no knowledge of advanced CS

Denis G08:09:45

truth has been spoken

Denis G08:09:15

but if you are not in academia, nor doing code-monkey job, then what do you do? OSS?

lemontea08:09:12

on a self-funded sabbatical… sometimes drastic action is needed to break through indecision

lemontea08:09:15

supposed to be doing OSS, but get a bit carried away with the study part. See, underestimating how long a task takes works even if you are not working!

Denis G08:09:28

😄 sure damn, doing smart things and getting paid for sounds like a dream. code-monkey job kills me. But academia job is just paying peanuts. Especially PhD work

lemontea09:09:55

one more hint on that course. Hilbert (or is it?) said that all Mathematician only has a few tricks. Here the basic framework is “Safety + Progress” proof. And with such a hostile env. (arbitrary delay, system can fail, async, etc) only a few “universal techniques” work (which you will hopefully discover as meta-pattern in the course)

lemontea09:09:04

but I can assure you that it is worth studying. High effort, high reward~

Denis G09:09:04

Absolutely! It feels good to study new things. Whatever new things are. But in CS it's always new concepts. Or combining concepts together to get other concepts or great things. At the beginning I was thinking you gonna refer to this book: https://en.wikipedia.org/wiki/How_to_Solve_It

lemontea09:09:09

just don’t obsess on special network topology in the course (depends on instructor I guess). Unless you work in data centre or have special application where those setting applies - stick to algo that are network agnostic

lemontea09:09:55

That book turns out to be more useful as a “Philosophy of Life” book than problem solving in math… maybe it’s just me

lemontea09:09:48

I was a backend dev back then

lemontea09:09:29

mobile dev is probably out of my reach given the backlog of things I want to learn/do

Denis G09:09:38

back then? before the self-funded sabbatical?

Denis G09:09:34

How long have you been on this study journey? Finally I convinced other guys from the team to use Rx on mobile. At least some new concepts 😅 Reactive programming is a such a hype nowadays.

Denis G09:09:52

Mobile dev is just a way to survive during studies 🙂

Denis G09:09:28

BTW, don't know about you, but I tend to forget things, which I don't use, this is why spaced repetition with Anki solved several problems keeping knowledge always in my head 😉

lemontea12:09:23

a few months. I finished a project that used ~1.x month of that time

lemontea12:09:35

if you mean how long it take to learn those distributed system + DB stuff, depending on your point of view it took me either just a few weeks, or 5+ yr 😉

orestis16:09:09

I think Clojure might be a little too high level if you are at that level of efficiency chasing, but I’m not an expert here.

Denis G16:09:35

sure. it was just a theoretical question 😅

Denis G16:09:17

@orestis here is an example of my thingy (proud 😄) for query

select c_id, c_first, c_middle, c_last
from customer
where c_last = 'BARBARBAR';
generated code:
rators/projection.t:15: terra anon (./operators/projection.t:15)(datastore : &Datastore) : {}
erators/tablescan.t:43:     var table : VectorT = (@datastore).customers
erators/tablescan.t:45:         for i : uint32 = [uint32](0),VectorT.count(&(@datastore).customers) do
erators/tablescan.t:47:             var tuple : &Customer = VectorT.getPtr(&table, [int32](i))
erators/tablescan.t:28:             var $c_first : &VarcharT = &(@tuple).c_first
                                    var $c_id : &Integer = &(@tuple).c_id
                                    var $c_middle : &CharT = &(@tuple).c_middle
                                    var $c_last : &VarcharT$1 = &(@tuple).c_last
erators/selection.t:70:             if let
erators/selection.t:42:                    var $464 : bool = true
erators/selection.t:51:                    $464 = $464 and VarcharT.equal(&@$c_last, "BARBARBAR")
erators/selection.t:55:                in
                                           $464
                                       end then
rators/projection.t:26:                 printf("%s | ", [&int8](Integer.toString(&@$c_id)))
                                        printf("%s | ", [&int8](VarcharT.toString(&@$c_first)))
                                        printf("%s | ", [&int8](CharT.toString(&@$c_middle)))
                                        printf("%s | ", [&int8](VarcharT.toString(&@$c_last)))
rators/projection.t:29:                 printf("\n")
erators/selection.t:70:             end
erators/tablescan.t:45:         end
rators/projection.t:15: end

orestis16:09:18

I believe though that there are Clojure like languages out there that might be what you want? Pixie, ferret...

orestis16:09:32

Try also #other-languages