Fork me on GitHub
#off-topic
<
2019-04-17
>
orestis08:04:17

Nice tool for sequence diagrams: https://sequencediagram.org/ — probably some open source library does the rendering as I’ve seen this language elsewhere — any clues?

dominicm08:04:50

@orestis looks similar to plantuml

mpenet08:04:07

+1 for plantuml, great little tool

dominicm08:04:49

Mermaid is quite great 🙂

orestis08:04:57

Seems exactly like plantuml

mpenet08:04:47

Cool little service related to all that if you want to play with various solutions: https://kroki.io/

agigao14:04:14

Data science from Scratch, 2nd edition.

😡 8
respatialized14:04:08

http://neopythonic.blogspot.com/2009/04/tail-recursion-elimination.html?m=1 GVR has been on record for a while as disparaging of functional constructs, so it makes sense that doing things the "Pythonic" way means rejecting them.

respatialized14:04:54

brb redoing all of "Data Science from Scratch" in Hy

hipster coder14:04:06

has anyone played with Clojure and Kotlin together on the JVM? I just discovered Kotlin last night. And I am hooked. I want to use it in combination with Clojure.

gklijs17:04:31

I actually called Clojure from Kotlin it's easy, not sure about the other way around, I guess you have the same kind of problems as using Kotlin from Java, https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html

Daniel Hines14:04:59

What’s Kotlin’s schtick?

hipster coder14:04:56

@dharrigan I will read right now. I was sold in the first 10 minutes on Kotlin… When they said it solves null pointers, composition over inheritance, does co-routines and type inferred.

hipster coder14:04:16

Java Fibers is very similar to Kotlin co-routines

dharrigan14:04:20

We use kotlin for 100% of our backend code here at work

dharrigan14:04:29

for 2+ years

dharrigan14:04:33

we are very happy with it

dharrigan14:04:44

in fact, I think I've lost my java skillz 🙂

hipster coder15:04:05

I am going to look at putting Kotlin on Vert.x along side Clojure

dharrigan15:04:22

(we use kotlin to handle millions of IoT messages per day)

hipster coder15:04:38

You are using a reactive programming model?

hipster coder15:04:17

no event loop similar to node js? for IoT?

hipster coder15:04:42

based on web sockets

hipster coder15:04:43

that’s what I want to find out about Kotlin… it sounds like it does async (event loop style) but with multi threading… so it’s the best of both

dharrigan15:04:06

start simple, get it working, then if there are issues, look to solve. No need to throw in an alphabet soup of tech just because you can.

hipster coder15:04:26

I am moving my stack off Rails onto JVM

dharrigan15:04:31

You'd be suprised how a basic (functional) stack works without throwing in a lot of tech

hipster coder15:04:53

has electronics or hardware experience helped you in the IoT? hacking on arduino or raspberry pi?

dharrigan15:04:45

Nope. Being able to understand basic binary operations mostly. We work with a variety of IoT devices, each of them talk to us over various networks, so decoding packet data (from specifications) is all you need mostly

dharrigan15:04:11

big endian/little endian work helps too 🙂

hipster coder15:04:22

is the JVM helping by virtualizing your code on the different devices?

dharrigan15:04:04

we have hundreds of microservices consuming from data being ingested via streams from these IoT devices.

dharrigan15:04:15

those microservices are written in kotlin

hipster coder15:04:26

Ok, then you must be using Spark or Storm?

dharrigan15:04:58

Just plain TCP network data, into Kafka 🙂

hipster coder15:04:01

you just collect the real time data directly into Kotlin?

hipster coder15:04:13

no message broker que?

hipster coder15:04:58

ahh ok, apache product… nice

hipster coder15:04:18

I am getting ready to build a real time data pipeline from a chat system

dharrigan15:04:33

We have had great success with kafka, however, YMMV.

hipster coder15:04:55

I can’t say I know enough… to compare Kafka, Storm and Spark

hipster coder15:04:40

actually, I first started by looking at Golang but then changed my mind about it for this use case

dharrigan15:04:09

Start simple, try kafka, then determine based upon your observed outcomes whether you need to add in more pieces, like storm/spark and all that entails.

hipster coder15:04:36

ok… sounds good. I will try Kafka for the first data pipeline

dharrigan15:04:54

If you can get messages streaming into kafka, and your downstream consumers reading those messages in a scaleable way, then you determine whether it's fit-for-purpose 🙂

dharrigan15:04:13

gotta go, home time.

dharrigan15:04:50

btw, clojure has nice libraries for working with kafka (like jackdaw)

hipster coder15:04:14

ya, I probably can use Clojure for the data side. And Kotlin for the web stuff.

dharrigan15:04:16

you might want to try an experiment of doing a parallel coding exercise between clojure and kotlin for the same problem and see which one you like

hipster coder15:04:31

ok, I will do that

hipster coder15:04:36

because Rails is too slow for web sockets

donaldball15:04:50

I’d be curious to see what the tradeoffs are between kotlin and clojure, assuming you have some level of mastery of both.

hipster coder15:04:17

do you have any ideas for testing the trade offs?

donaldball15:04:24

Informally, I’d aver that clojure is aimed squarely at folk implementing systems that manage data, with good stories to tell around handling concurrency. It could be said to trade away some performance in that pursuit, and has a higher learning curve for most folk. The story I’ve heard around kotlin is mostly “java but better” but I suspect that’s giving it short shrift, so I’d be curious to hear the perspective of folk actually using it, esp. if they also use clojure.

hipster coder15:04:26

I use Clojure for scraping web pages. I like it because it is succint. I am very new to Clojure though. I know it shines in the data world.

dharrigan15:04:52

I think Kotlin comes from a very pragmatic "middle-way" approach that doesn't go to extremes (such as Scala) or verboseness (Java). It was designed to get the job done, easily, succiently and with the mimimal of learning curve for java programmers

dharrigan15:04:17

We find it easy to write very terse, easy-to-follow programs that are also easy to test and maintain and (re)training java developers to use kotlin was very painless. Everyone had abandoned java (given the choice) after a couple of days of working on kotlin

dharrigan15:04:31

(with some hand-holding for a while, until they got better and better)

dharrigan15:04:06

We use everything in the section What Kotlin has that Java does not:

gklijs17:04:53

Liberies like Lombok offer some of the same things to Java, but because it's not first class it's not working as well. While Kotlin is a bit more functional then Java it's way more oo then Clojure. I would choose Clojure over Kotlin myself. But if I would choose for a team of Java developers it would probably be better to go with Kotlin

hipster coder18:04:43

Ya, I still love Clojure. I do like a few things about Kotlin… built in the null object pattern, composition over inheritance, async but with procedural style code (no callback hell)

gklijs18:04:38

About the null safety, I had the same implementation in Clojure and Kotlin. But when switching to Kotlin the program crashed because there where null's in the database. Some issue arises with interop. In that respect I much rather like the Clojure approach of almost always returning nil when called on null/nil. But not always since (read-string nil) does throw an error. Seems like only an advanced type system like with Haskell or Rust can really safe you here.

hipster coder18:04:01

I wrote a null object pattern in Ruby. I wonder if I will need that pattern in Clojure. It’s usually useful in places like a view template… so an error isn’t thrown when data is nil/null

hipster coder15:04:37

@donaldball any ideas for testing both?

hipster coder15:04:03

I’ve just been writing simple algorithms and speed testing different languages

hipster coder15:04:30

let’s thread this… and not take up the whole channel

hipster coder17:04:13

is anyone using the screen share tool inside VS Code?

jaide17:04:33

I could use a bit of git help. Currently there’s some code that was added to a module written 2 years ago, however I’ve updated the module since. What’s the best way to pull in changes from specific files written 2 years ago without losing the changes made more recently?

gklijs18:04:22

First make sure all changes also are on remote branches. Then you could either rebase or merge (locally). Once your sure it's working and contains both changes push.

hipster coder18:04:06

git cherry pick might help too. it helps you only merge specific files, 1 at a time.

hipster coder18:04:03

I’d make sure to create a new branch just to do the rebase or cherry pick… in case it goes wrong

jaide18:04:48

Ah yeah, was thinking about git cherry pick. Unfortunately there’s a bunch of commits but only some have files I want. But yes, I’ll create a copy of the branch so I can try out these methods first.

dominicm18:04:14

@jayzawrotny you can do git log file.txt and then git diff commit ^!

👍 4
hipster coder18:04:28

ya, just using git diff to find the changes… if it’s only 1 file, you could even cut-n-paste

👍 4
dominicm18:04:52

If you aren't confident, copy paste is very safe.

jaide18:04:05

It’s like 20+ several files, 1000s LOC in some of them

dominicm18:04:12

If you do make a mess, git reflog is your friend

dominicm18:04:31

The diff can be saved, and reapplied if need be.

hipster coder18:04:42

make sure you create a branch just to do the merging

hipster coder18:04:18

git is usually 99% safe… only time I ever lost work was when I used -f to over ride something

hipster coder18:04:56

rebasing can be a little dangerous too, because it can rewrite your history

gklijs18:04:59

As long as the branch your rebasing already exists remote, and you only push after your confident it works you should be safe.

hipster coder19:04:40

pretty much, the only rebase that I use quite often is that

git squash
that condenses several commits into 1

Lennart Buit19:04:44

I rebase all the time

Lennart Buit19:04:56

I just have some pristine copy of my code somewhere on my FS

Lennart Buit19:04:02

just in case :’)

gklijs19:04:56

I rebase as much as my team members allow me to, which basically means just the feature branches only I work on.

Lennart Buit20:04:11

yeah that makes sense. Also, rebasing isn’t perfect for “catching up”.

gklijs20:04:03

I really would like to rebase more but that's only possible if we would all work on our own forks, an then rebase on the origin's fork.

Lennart Buit20:04:45

wasnt it you @U09LZR36F ,that linked the git flow used by git itself?

jaide18:04:25

I had created a new branch off the latest stable branch. Ran git checkout <branch> <paths> from the older experiment, then looked at the diff and realized I would be loosing changes if I committed this.

hipster coder18:04:20

are you running unit tests?

hipster coder18:04:12

I ask because… are the changes something incremental that you can test in steps… or is it 1 giant refactor of some code

jaide18:04:27

We do have a fair amount of unit tests, and a QA person to run through smoke tests, but the testing situation is not as strong as I’d like.

jaide23:04:10

http://cl.ly/c920fac5937c so that’s the situation. I want to pull a few files from the old branch into the new branch without loosing the changes in the stable branch that have happened since.

jaide23:04:27

After some research it sounds like I should make a copy of the old branch, use git reset --soft <first commit before old branch> and get rid of all the files I don’t care about. Then do a git rebase -i stable to squash\drop commits to get the latest stable in there. Then do a git diff stable^..<old-copy> <files> | git apply to patch the new branch with those updated files.

jaide23:04:49

Though I may be able to take that updated, rebased old and just merge it into new since it would only have the files I care about, and be up to date with the latest stable at that point.

jaide23:04:08

Anyway, thanks everyone for the help\suggestions so far. At least now I have a plan 🙂

guillaume23:04:43

have you tried git checkout <sha> -- path/to/file.clj

jaide23:04:12

I have, but I would lose some changes to path/to/file.clj made in the stable branch