Alvin Alexander
alvinalexander.com · Personal blog · on HN since 2012
Alvin Alexander, a programmer, writes tutorials and notes on Scala, functional programming, GIMP, macOS, and Android.
What HN saysHN links it for a GIMP circle-drawing tutorial (in complaints about basic GIMP tasks) and a post arguing the IO monad is not pure.
35HN people shared it
25linked it in comments
10stories submitted
119story points
2 years agolast shared
2012people per year2026
Most-shared posts
- 1Gimp how to create draw circle in gimp tutorial3 people · first shared 2020
- 2OS X's launchd, demystified2 people · 8 points · first shared 2013 · discussion on HN
- 3GraalVM apps run faster than Scala/Java/JVM apps, with less memory consumption2 people · 3 points · first shared 2020 · discussion on HN
- 4How functional programming is like unix pipelines2 people · first shared 2019
- 5Head asleep, body awake1 people · 95 points · first shared 2020 · 97 comments on HN
- 6What is Android doing when it says “optimizing apps” after a system upgrade?1 people · 4 points · first shared 2015 · 2 comments on HN
- 7SARAH, a Mac OS X speech interaction app1 people · 3 points · first shared 2016 · discussion on HN
- 8MLB.TV hidef not supported on Mavericks (OS X 10.9)1 people · 2 points · first shared 2014 · 1 comments on HN
- 9Recursion – See Recursion1 people · 2 points · first shared 2022 · discussion on HN
- 10Introduction to Scala 3 (video course)1 people · 1 points · first shared 2023 · discussion on HN
- 11Learning Recursion: A free booklet, by Alvin Alexander1 people · 1 points · first shared 2023 · discussion on HN
- 12Io monad doesnt make function pure obvious impure1 people · first shared 2021
- 13How to use if then expressions guards in case statements scala1 people · first shared 2019
- 14Linux ls command how sort by filesize reversed1 people · first shared 2019
- 15Dinosaurs noahs ark oh crap today.jpg1 people · first shared 2018
What HN people wrote when they linked it
flowerlad · 2021-06-08
> The hooks follow similar laws to Monads.
And monads are impure [1]. If all your functions are impure then you're not doing functional programming.
[1] https://alvinalexander.com/scala/io-monad-doesnt-make-function-pure-ob…
mitchtbaum · 2019-01-08
I can't find it anymore, but from it I learned for the first time that functional programming can be understood simply as programming using component-oriented design - from then on, my favorite programming concept. I have a huge interest in software composition, so here's at least something I could find that explains it well:
https://alvinalexander.com/scala/fp-book/how-functional-programming-is…
gus_massa · 2016-01-15
I saw this video that you linked in HN. I think you should add it to your page too.
I found these screenshots: http://www.exeone.com/vintager-gallery .
I still would like to see more/bigger examples. Something like http://alvinalexander.com/design/gimp-catalog-filters-effects-examples… (130 is too much, pick the best 10 or 20 of your effects) (I'm totally unrelated to this site, it's the second link in https://www.google.com/?q=gimp+filters+examples+galery )
Don't worry about the inconvenience. Here is usual to try to give feedback. Most users go to the site and if they don't find what they want, they just go away. Here we try to provide some advice (sometimes it's good advice, sometimes it's bad advice). I hope these comments help you. Welcome to HN!
peter-m80 · 2024-11-29
I found a simple 8-step guide to draw a circle:
https://alvinalexander.com/gimp/gimp-how-to-create-draw-circle-in-gimp…
Please gimp devs, fix the basics
kstrauser · 2024-02-22
Here's a tutorial from this month explaining how to do it: https://alvinalexander.com/gimp/gimp-how-to-create-draw-circle-in-gimp…
So yeah, looks like it.
eurasiantiger · 2022-11-17
“The IO monad does not make a function pure. It just makes it obvious that it’s impure.”
— Martin Odersky
https://alvinalexander.com/scala/fp-book/pure-functions-and-io-input-o…
dboreham · 2021-10-12
Monad imho is deliberately badly explained to preserve the mystique and the smugness of the cognoscenti. I found this book invaluable for translating the field into something that makes sense: https://alvinalexander.com/scala/functional-programming-simplified-boo…
alexfoxgill · 2021-09-19
It is used heavily in Scala https://alvinalexander.com/scala/how-to-use-partially-applied-function…
huonib · 2021-04-16
I'm sorry, did you claim poor tuning?
look at this graph:
https://alvinalexander.com/sites/default/files/inline-images/java-v-gr…
from:
https://alvinalexander.com/scala/graalvm-native-executables-faster-tha…
mr_overalls · 2020-09-16
We are also capable of realizing directly that personal identity itself is also construct, a mask we put on to make sense of the world. Seeing through this illusion can be deeply unsettling, as well as deeply liberating. E.g. Buddhist insight into anatta, or non-self.
Shinzen Young's description on the nuts and bolts of Shingon Buddhist deity yoga practice is simply fascinating.
https://alvinalexander.com/personal/shinzen-young-shingon-shinto-winte…
https://www.youtube.com/watch?v=Q_VizlDWcTA
yashap · 2020-05-01
This seems a little too magical for Java - normally indentation doesn’t have programmatic meaning like this in Java. I prefer the Scala approach: https://alvinalexander.com/scala/how-to-create-multiline-strings-hered…
Just seems more obvious/clear.
bjourne · 2019-12-15
Because the documentation seldom is good and almost never really good. Long and "complete" documentation isn't the same thing as good documentation.
I have a piece of software and a task I want to accomplish. For example, list files ordered by size in ascending order. ls' man page tells me how to do that, but I have to piece the information together because it is arranged option by option. Thus, I'm forced to read more than what I'd like.
Or I can google "ls sort files by size" click on the first link https://alvinalexander.com/photos/linux-ls-command-how-sort-by-filesiz… and voila.
Most people writing docs don't get that people learn by example. Thus the docs they write lacks examples and therefore are not very useful.
based2 · 2019-08-19
jfhufl · 2019-01-22
Hmmm, well that's why I like Ruby and other languages with functional approaches. Method chaining and blocks are very similar to pipes to me.
cat /etc/passwd | grep root | awk -F: '{print $3}'
ruby -e 'puts File.read("/etc/passwd").lines.select { |line| line.match(/root/) }.first.split(":")[2]'
A little more verbose, but the idea is the same.
https://alvinalexander.com/scala/fp-book/how-functional-programming-is…
lake99 · 2018-11-22
You're using the emacs definition of major modes. "Modal editor" has a different meaning. Vim has three modes [1]. Emacs is not considered a modal editor, but some of its features are similar to Vim's last-line mode.
[1] https://alvinalexander.com/linux/vim-vi-mode-editor-command-insert-mod…
pedrow · 2018-09-26
You can install side-by-side (I have 1.8 and 11 both installed) and switch using java_home, see https://alvinalexander.com/macos/how-to-set-mac-osx-java-version-path
vorg · 2016-05-16
I don't like having to use a different language (i.e. Apache Groovy) to write build scripts when using Gradle with Scala. With SBT, I write Scala to build Scala, see [1]. I can see why someone would use Groovy to build a Groovy project, but why should I use 20 lines of Groovy to build Scala?
I notice Kobalt [2] for Kotlin is still being actively developed, and Leiningen for Clojure, both using the syntax of the language they're compiling for their build DSL. If Gradle won't become language agnostic for specifying its build scripts instead of shoving something else down people's throats, people will elsewhere, or stick with Maven.
[1] http://alvinalexander.com/scala/sbt-syntax-examples
[2] https://github.com/cbeust/kobalt
mahyarm · 2015-01-31
No I don't really think so. Otherwise python and ruby would trigger similar fears.
And I work with Objective-C a lot. There is a downside to theExtremelyLong:message passingStyle:functionNames
You could say similar things about applescript too, yet I've never met anyone who actually uses it:
http://alvinalexander.com/blog/post/mac-os-x/applescript-list-examples
Smalltalk was good and it inspired a lot of future things but it didn't succeed because it had a bad $ price / performance ratio in the 80s and the image system created too much coupling compared to files.
yareally · 2013-11-25
Scala does something similarly neat with using #| for piping system commands.
Slash for Scala is not used by default though for path joining, but it can be by adding an implicit function:
implicit def slash(str: String) = new { def /(joinStr: String) = str + java.io.File.separatorChar + joinStr}
val joinedStr = "abc"/"def"/"ghi"
> joinedStr : java.lang.String = abc/def/ghi
Shell friendly syntax can be used for stdin/stdout in Scala as well (already in the stdlib with no implicits required):
#< Redirect STDIN
#> Redirect STDOUT
#>> Append to STDOUT
#&& Create an AND list
#!! Create an OR list
http://stackoverflow.com/questions/12772605/scala-shell-commands-with-…
http://alvinalexander.com/scala/scala-execute-exec-external-system-com…
eeperson · 2013-10-25
I'm not sure I understand why this is a problem. SBT, leiningen, maven and pretty much every other build tool on the JVM supports publishing source jars. I think SBT even does it by default. Nearly all of the open source projects I have worked with on the JVM publish their source jars (Grails used to not but even they do now).
Are you running in to a lot of projects that don't publish their sources?
Also, SBT can use use other SBT projects in github repos as depedencies: http://alvinalexander.com/scala/using-github-projects-scala-library-de…
benzor · 2012-12-24
Nicely done!
Side note: for those of you inclined to try this, or make use of Java's Robot class in any way, a word of warning: Robot takes over your mouse and/or keyboard entirely, so if things go wrong (e.g. an infinite loop) you'll have to restart your computer. It can do far worse if you're not careful, too, so feel free to read up on the mistakes of others before running in guns blazing.
http://alvinalexander.com/java/java-robot-class-example-mouse-keystrok…
logicallee · 2018-10-19
That's true. Until it was discovered, Troy was considered to be mythical. Now most people think we have Homeric Troy.¹
But how far do we go? We practically have the specifications for Noah's ark ² - so do you expect us to find it, large enough to house every animal except dinosaurs, cruelly left out? ³
So at first I thought you made a pretty good case, but I don't know, man. There's a lot of weird stories that are super specific, like the one I just quoted.
--
¹ https://en.wikipedia.org/wiki/Troy
² https://www.biblegateway.com/passage/?search=Genesis+6&version=KJV - "The length of the ark shall be three hundred cubits, the breadth of it fifty cubits, and the height of it thirty cubits. A window shalt thou make to the ark, and in a cubit shalt thou finish it above; and the door of the ark shalt thou set in the side thereof; with lower, second, and third stories shalt thou make it..." etc.
³ https://alvinalexander.com/sites/default/files/styles/preview/public/p…
vsync · 2013-04-17
For feature implementation speed, function point analysis (http://alvinalexander.com/FunctionPoints/) is a good start. There are tables available that give rough industry-wide figures for hours per function point. However keep in mind these will change quite a bit depending on the size of the project, the competence of the team as a whole, unique constraints on the particular software, and the tools in use; we're talking a range of 1/2hr to 20hrs per function point, so you need to factor those items in. Also you have to be willing to break down the requirements in ways that are a little odd sometimes when dealing with more interactive applications (say, games versus spreadsheets) or that have long-running processes (daemons versus batch).
Speed of learning is much harder to quantify because people aren't uniform in the experience they already bring to the table. So you'd have to administer tests of some sort across a wide variety of things to encompass things they do and don't already know.
But the talk of "objective metrics" for the "quality of developers" sounds a little bit leading, making this whole question seem a bit off-putting. You might be well-served by reading "Zen and the Art of Motorcycle Maintenance", especially the parts where Pirsig describes the difficulty of assessing Quality without already being an expert in the subject.
coldtea · 2016-03-06
Well, how involved are you? Did you see much good work this last 5-6 years from the part of Oracle? Could there be anything more they could do to downplay Java and alienate the community?
http://www.infoworld.com/article/2987529/java/insider-oracle-lost-inte…
https://jaxenter.com/oracle-and-javas-planned-obsolescence-121144.html
http://fortune.com/2015/09/07/oracle-cuts-java-execs/
http://www.zdnet.com/article/a-close-look-at-how-oracle-installs-decep…
http://www.infoq.com/news/2015/09/oracle-purges-java-evangelists
http://www.computerworld.com/article/2469593/open-source-tools/it-s-no…
http://arstechnica.com/information-technology/2010/11/apache-foundatio…
https://dzone.com/articles/oracle-announces-jigsaw-delays-push-java-9-…
https://jaxenter.com/even-if-oracle-is-losing-interest-in-java-should-…
http://alvinalexander.com/java/doug-lea-leaving-java-community-process…