HNHacker News
TopNewBestAskShowJobs

thibran

566 karma · joined July 2, 2017

submissionscomments
thibran··on My PHP Development Setup
For example you can't just write [1, 2, 3]->map(...) in PHP.

Right now the best is to use something like Laravel's collect, e.g. collect([1, 2, 3])->map(...). Oftentimes all you want is to add one method to an object. Right now you would have to sub-class it or write an ugly wrapper function.

Infix-Functions are one way to "extend" functionality without messing with inheritance – with other words, you can easier express what you mean with less code in an consistent way. In Android dev, Kotlin and Infix-Functions are quite popular. Too often in PHP you have to write some_function($object). The other thing is that PHP has a lot of strange function names and Infix-Functions could help to give the language designers a second chance to come up with better names, even if the Infix-Functions just call the existing code.

thibran··on My PHP Development Setup
Modern PHP is much better than the old one. One feature I miss from Kotlin are Infix-Functions: https://kotlinlang.org/docs/reference/functions.html#infix-n...

Even the newest PHP feels somewhat dated, Infix-Functions could reduce a lot of typing by making library and custom wrapper code – which almost always exists – resemble more.

  function foo(String $s) {...}
  // current function call syntax 
  foo('hiho');

  // just syntactic sugar - below code is the same as above
  function String.foo(String $s) {...}
  'hiho'->foo();
thibran··on Coolest Things I Learned in 2018
Humans with the ability to explain something in a structured way are rare because it requires a lot of different skills. First you need to know the topic well. Second you need to have emotional intelligence to know to current level of your trainee, to get him/her onboard with the new knowledge. Third you have to think about how to group and link the information you want to communicate. Forth the content must be reduced to the bare minimum and then plan what else should be explored, since learning with a tutor is most times the beginning of a voyage and not the end. This is hard, so people fail at it all the time.

The default – a.k.a fallback method – is to just list all things. This is not only confusing as hell, it is even worse. You never know what you don't know with this methodology, because you have absolutely no context about how something is meant to be use...

For example Books about programming languages often explain only the rules of the language, but totally forgets to explain how the language is used in practice and which tools are commonly used or which homepages have useful content that almost every programmer of language X uses. A greenhorn has understandably a very hard time without all those information.

E.g. setting up a Common Lisp project with Quicklisp which has the code under a namespace takes 20-30 steps (installing Quicklisp using a Lisp REPL, configuring Emacs, configuring the project) – no wonder almost everyone gets lost in the process. And a lot of programming languages are like that.

thibran··on Game dev: Linux users were only 0.1% of sales but 20% of crashes and tickets
I was one of the PA Kickstarter supporters and played the game on Linux. It never worked flawlessly (graphical glitches). Today however I can play the latest DOOM (through Steam) on Linux using Vulkan without problems using an AMD card and open-source drivers. There is no reason not to build games for Linux, just use Vulkan and graphic problems are a thing of the past.
thibran··on Why Emacs keys are painful (2007)
Thanks for the suggestion to use view-mode. I bound a quick double-tap of vv.

    (use-package key-chord
      :init
      (key-chord-mode 1)
      ;; (key-chord-define-global "jj" #'avy-goto-word-or-subword-1)
      (key-chord-define-global "vv" #'view-mode)
      :custom (key-chord-one-key-delay 0.3))
thibran··on Small stupid things that make up my dev environment
I have it in my i3 config: exec --no-startup-id sleep 2 && /usr/bin/xset r rate 200 40
thibran··on Small stupid things that make up my dev environment
For the typematic delay, I have no clue why it is so slow on Linux by default. Probably somebody has set those values 30 years ago and then nobody cared to update them. I use 'xset r rate 200 40' and when I use another Linux computer, typing feels just broken, super slow (Windows has better defaults than Linux in this regard). The weird part, there is no reason why keystrokes should have such a huge delay. Changing the xset values improves the user experience in a quite dramatic way.
thibran··on Rust 2018 survey results
Getting concurrency right is difficult, even in Go (I know, I have been there, it was a huge pain in the a$$). Rust guarantees via the borrow checker that the code is data race free. This alone is a huge advancement. I would argue that Rust contains as much boilerplate as Java, but Rust is as fast as C++ and safer than both.

-> You trade some code noise for safety and speed. Compared to C++ the code has even less noise.

Turning code into concurrent code is super easy in Rust. Just use the Rayon crate and change iter() functions into par_iter() and you are done (if the borrow checker doesn't complain).

thibran··on OCaml for the Masses (2011)
These kind of blog posts are one of the reasons why I love the internet, and why Hacker News is such a great place.
thibran··on Nnn – a terminal file manager for programmers
... never close it :)
thibran··on Nnn – a terminal file manager for programmers
Emacs Dired + Tramp -> no need for any other tool.

One super awesome Dired feature is C-x C-q to edit a folder like a file (all Emacs commands work here, like macros which are easier & faster to get right than most shell commands). To save your changes after editing, press C-c C-c.

thibran··on Ask HN: Is Google failing at UI/UX/design simplicity in its products?
I too navigate to google products by typing in the URL instead of using their UI.
thibran··on Microsoft resumes rollout of Windows 10 version 1809, promises quality changes
I wish Microsoft would update Windows to use a Chrome OS like update system with delta updates and read-only system partitions. When partition A is in use (mounted read-only), an update would create a copy of A on partition B. Then download a binary delta and apply it to B to update B to the newest OS version. On the next system start partition B would be booted, if there is an error restart to partition A (a known working state), otherwise B is marked as 'good'.

It's 2018 and updates are still slow to apply and/or break computers... what a strange world.

thibran··on Ask HN: Companies using Racket?
Hi,

I found your meetup and would really like to join - too bad that the company I work for is holding a conference at this day (www.talentthinking.de). So I may join for Episode 2.

thibran··on A packaging tutorial for Guix
> Typically commas and semicolons don't have to be matched with open-commas and open-semicolons

This is a problem that is non-existent when you use common tooling to write Lisp, like ParEdit or Smartparens. Since nobody would write C++ in Microsoft Word, nobody writes a lot of Lisp code without auto-matching parentheses tools.

thibran··on Falling in love with Rust
The code could use closures to split the expression or define local functions on the bottom of the surrounding function (a.k.a Haskell style). This would increase readability a lot.

Example: https://play.rust-lang.org/?gist=7ea1a39971399d0429f0369cb9e...

thibran··on Slow leak detected aboard Space Station
ISS Live Stream: http://www.ustream.tv/channel/live-iss-stream
thibran··on CLI: Improved
If you like exa, maybe you like my modifications about hiding the time output optionally when using '--long', too.

https://github.com/thibran/exa/tree/time_style_hide

Example output of 'exa -l --time-style=hide':

    drwxr-xr-x - foo Desktop
    drwxr-xr-x - foo Documents
    drwxr-xr-x - foo Downloads
    drwxr-xr-x - foo Music
    drwxr-xr-x - foo Pictures
    drwxr-xr-x - foo src
    drwxr-xr-x - foo Videos
thibran··on CLI: Improved
rg > all other grep tools

https://github.com/BurntSushi/ripgrep

thibran··on Go 1.11 and Beyond
No, they solve a complex problem.

Have a look at modern web development. Because they have no macros, they wrote a bunch of tools which "compile" different domain specific languages (DSL's) to "the real stuff". Nowadays you compile pseudo HTML, pseudo CSS and JavaScript (modern style) to HTML, CSS and JavaScript (backward compatible, a.k.a. old style JS). That's insane. On the other hand, whiteout those code-transformation tools – which are called macros if they are built into the language – all those fancy and simple web-tools would not be feasible.

Ignoring macros means to me oversimplifying programming. Which results into not solving the real (meta) problem. For a while you will get away without macros/code generation, but in the long run they are inevitable.

thibran··on Flatpak 1.0 Released, Ready for Prime Time
Sure it's Canonical's NIH and not Red Hat NIH, since both got released in December 2014?
thibran··on Lisp and Haskell (2017)
My problem with Haskell is that it is not pragmatic and the reason I stopped using it. The philosophy of separating pure and impure code – and to enforce it – does more harm than good. Often its difficult to understand what your "forth level of abstraction code" above the usual abstraction levels really does. Haskell is fun to learn. Haskell has a lot of interesting concepts to explore and it will make you a better programmer. Haskell code can be really dense. And Haskell code can be totally unreadable, using concepts which take weeks to learn – which is... not so great.

Lisp (Common Lisp) is what you get when you reduce the rules and syntax to a minimum and try at the same time to be a maximal flexible programming language. This simplicity and applied pragmatism is what makes it so great. Like the authors in the Lisp books warned, after learning Lisp, coding won't be the same. Now I see everywhere code that could easily be written in Lisp, but is not so great in language XYZ. All those SDL's and stringified API's and code-generators they need to do real things and data formats like JSON... all obsolete, if they would have chosen Lisp (or a language with brackets and Lisp like evaluation rules).

The other thing that is often overlooked regarding Lisp is, that in a Lisp like language there is no need to wait for a new version of the programming language to be released to get new syntax – you can simply add it yourself (or have a library doing it for you). E.g. a lot of the JavaScript mess could be fixed by code transformation, if they would have chosen a Lisp like syntax in the first place.

I don't see Haskell as uber language. If I want super correct code, speed and I'm okay with using a more complex language, then there is Rust – which is probably more correct than Haskell and faster, too.

Haskell, Lisp and C++ would really benefit form a std library 2.0 and a default package manager... one can dream.

thibran··on Completely Silent Computer
Raspberry Pi + i3 + Chromium + Emacs = <3

100% quiet, not super fast, but fast enough.

thibran··on Common Lisp homepage
It might surprise you, but Lisp is actually mixed typed. Here 'object' is of the type integer:

    (defmethod description ((object integer))
      (format nil "The integer ~D" object))
http://lisp-lang.org/learn/clos
thibran··on Common Lisp homepage
What confused me a lot is that nobody seems to give an example on how to build a binary out of a Lisp program/make it runnable from command-line.

Also most tutorials/books I found don't guide you on how to build an application/structure your code – which is rather confusing for a beginner. You have to spend a lot of time and try and error to get things working using Quicklisp. I got often the impression, that since Lisp is so old, everyone using it knows how to do things and forgot to document for newcomers their knowledge.

thibran··on Keep VS Code from Becoming an IDE
A lot of people overlook that the real power of Emacs is that it is in reality just a huge Lisp interpreter which got some text-editor functionality builtin. Once you understand that, and know some Lisp, there are almost no limits in what you can do. It is super simple to get the documentation for everything and it is often quite easy to extend Emacs's behavior in the way I would like it to behave.
thibran··on Ubuntu 18.04 LTS Bionic Beaver Released
* Traditional Windows Apps => bazaar, everyone does whatever they want

* Snap Apps => centralized, the snap-system updates the apps on a regular schedule

Traditionally on Linux there was only the system-package-manager to update the system and applications. Snaps are confined (unless declared --classic) and allow to have a stable base-system and up-to-date applications.

PS: Can't say much about how snaps compare to macOS.

thibran··on Ubuntu 18.04 LTS Bionic Beaver Released
To get the latest version of an app you can use snap-packages. E.g. to always get automatically the newest version of LibreOffice: sudo snap install libreoffice

Don't forget to remove the preinstalled – and soon outdated – .deb-package version of LibreOffice :)

thibran··on Trump Attacks Amazon, Saying It Does Not Pay Enough Taxes
> Did they pay taxes on the products they sold in Germany?

Almost not.

> If so, I'm not sure what your problem is with them?

Apple is probably the company paying fewest taxes of all companies in Germany. Normal mortals pay much much more taxes.

There is a difference between paying almost no taxes, and paying the same tax as everyone else. In the end small businesses can't move their money to Cayman islands or wherever and factually circumvent the law. We have a lot of old infrastructure which needs some money, like schools: http://www.spiegel.de/lebenundlernen/schule/lehrerverband-fo... -> such buildings are not uncommon in certain areas.

One of the biggest newspapers and one of the most prestigious in Germany (Zeit) estimated that Europe lost alone over iPhone sales in the last five years 8 billion euro taxes.

thibran··on Trump Attacks Amazon, Saying It Does Not Pay Enough Taxes
Wrong country and maybe wrong company.

Apple pays so few taxes in Germany – approximated 2,8% taxes on their earnings – that the public is totally pissed (but it is for incomprehensible reasons legal). World wide Apple made ~62 billion dollar last year, but paid only ~25 million tax in Germany (0,2% of the total). At the same time they sell a lot of products here, this is so wrong. I guess Amazon is not better, but the real sinner is Apple.

← PreviousPage 6 of 8Next →