Fork me on GitHub

> 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 🙂

😕 4

I like that dude's enthusiasm 🙂


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: is a mix of chinese (I suppose) and english statements and citings 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?


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?


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


Yes, @denisgrebennicov that sounds about right to me.


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


But most people will just do macros instead.


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


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 ( for db query compiler backend 😄 She has exactly the same topic. 's gonna be an interesting watch. Thanks


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


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 😄


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


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

Denis G16:09:41

it is for in-memory db


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: 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


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>


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


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


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)


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


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


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


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


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


even though the link should be obvious/easy to find:

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 😉


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


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 😅


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


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


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?


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


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?


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


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


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)


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:


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


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


I was a backend dev back then


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 😉


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


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 😉


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
                                       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


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


Try also #other-languages