ADTs and pattern matching in #Python?
https://www.python.org/dev/peps/pep-0622/
I fucked up production because I've forgot that `groupby` in Python differs behavior based on order of keys.
#TIL #python groupby function groups by in local context. It actually groups only things that belong to single group inside continuous group.
Example:
group by of this stroke:
[k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D A B
What I actually expected it to do:
[k for k, g in groupby('AAAABBBCCDAABBB')] --> A B C D
I am playing around and implementing some #monad types in #python
https://gist.github.com/cleac/f30d99ac9df31a8383766e9b2eaf97d8
Here is what I've got. Pretty simple and not fully implemented, but totally fun :)
Now I can tell, why I think that #python and #javascript are not that good for starters. You get used to with the fact that all your applications will execute in single thread and there is no concurrency in your code at all. But when you get to paralel processing of data, you make stupid errors of context syncrhonization.
Back to the social media.
Was debugging #Spark again for several previous days. Things that I've learnt during another deep debugging session:
1. It seems that it doesn't like when you try reading old checkpoints
2. Do not use different schemass for serialization in same application, or you will spend a lot of time debugging them.
3. #Scala is statically typed language that allows you to make things you can do in #Python, but with guarantee that if it compiles then it will at least work.
Giving my laptop some hard time in recoding thing from mp3 to ogg. Also, first time in my life I found out that it is easier to write a #python script that to write #bash script to work with files with spaces. It took for about several hours to try making script in bash and about 15 minutes to write a python script that does literally the same, faster and more stable! #Linux #nerd #life is hard :D
Last evening I was doing two things at the same time:
1 - I was writing a universal DSL for querying languages using native #Python type hinting (I call it naiiveORM). Will open source it when ready.
2 - I was playing Serious Sam: First Encounter. I’ve played it a bit when I was a child, but now I like it so much. And all that on #Linux thanks to #Proton.
More I dive into #Scala more I understand that there is something wrong with #Python.
Reason is very simple: Python declares to be expressive and easily language, but lately I feel that most of the time I just fight the interpreter to express my thoughts. And with Scala, I just write my thoughts straightforward, and they just work. Easily and fast, without any hacks and fighting language
#Python development feels pretty decent in #vim if you use #LSP. It is one of the best things made recently, nevertheless it was created by Microsoft.
Why? Because it makes development tools agnostic to editor you use. You use the very same tools, when you use Atom, ViM and Emacs or anything else that supports those protocols.
This is what should be made years ago, when the "editors war" just started.
Found out how to make distribution package in #python. It was pretty, and I make miniflux-cli lighter on cpu and without re-render blinking while terminal is idling. Kind of version 0.0.2, proof of concept
https://github.com/cleac/miniflux-cli
*** THIS IS A DORMANT ACCOUNT ***
If you want to follow me, go to @alex