Can you use the terminal for everything? [video] - <AUTHOR> https://www.youtube.com/watch?v=0-2Ja7T9YF8 <comment><USER2> [https://neomutt.org/](https://neomutt.org/)

The guy is absolutely right. Mutt is not a gimmick like ascii video on terminal.

It actually makes a lot of sense as an email client and is surprisingly ergonomic. I also enjoy the fact that my config is a normal dotfile that I can version control etc. Also, your passwords can be encrypted using the tools that you choose, as opposed to whatever home grown crypto (if any) the [insert random Electron email client] uses. Some ways are outlined here:

[https://www.mail-archive.com/mutt- firstname.lastname@example.com/msg36375.ht...](https://www.mail-archive.com/mutt- firstname.lastname@example.com/msg36375.html)

<comment><USER3> "The guy is absolutely right. Mutt is not a gimmick like ascii video on terminal."

I personally use (al)pine and I could not agree more.

But here is a different, and I hope very provocative, reason that you should consider a terminal email client:

Local mail delivery does not traverse the Internet, or any network.

So, for instance, when I send an email to one of my engineers at rsync.net, even though it is sent in plaintext, it is a private communication and cannot be intercepted by either an ISP or some global observer. It's nothing but a local file operation between two mailspools...

Further, it would be extremely difficult to phish someone who is viewing their email in the terminal. The effort that it takes to view and copy a URL is greater than the discernment required to identify it as suspicious - so you'll catch them every time.

<comment><USER4> Is Alpine still getting security updates? UW doesn't maintain it anymore, like at all. It exists as git repo out in the ether [1]

I'd probably run it in a non-privileged container.

Infact, I should be doing that for Mutt ...

[1] [http://repo.or.cz/alpine.git](http://repo.or.cz/alpine.git)

<comment><USER3> "I'd probably run it in a non-privileged container."

Does mutt talk to the network or have a daemon or run as a service ? I don't know the answer to that but I know that for my own use-case, pine is basically a text editor. It executes no programs or code and does not talk to anything but the local SMTP daemon.

How much sanity checking and bounds checking does sendmail (or postfix or whatever) do on email ? That's the question, I think, because again, in my case, the threat vector is _very limited_ \- basically an arbitrary (weird) email or piece of an email that somehow breaks pine.

So no, I don't run it in a container - in fact, I run it as the user whose mail spool is the highest sensitivity asset that user owns ... so a container wouldn't help. If you get the mail spool, you get everything - at least or that user...

<comment><USER4> When I used Alpine, it was talking to IMAP and definitely segfaulted a couple times. But an RCE in Alpine != RCE in Postfix (great architecture). I dunno MUAs are so personal, they feel like a perfect place to target and handle more edge cases than upstream processes.

</comment></comment></comment></comment></comment><comment><USER5> Seems like the kinds of people who'd make/watch a video rather than read/write about the topic are not likely to be able to answer "yes".

Is there a transcript? Or is the summary "no"?

<comment><USER6> IMHO The 20+ years spent trying to make a desktop version of linux has SEVERELY reduced overall knowledge of unix practices and patterns. I'm not just talking about things like automake or the contents in /bin that younger programmers never learn, but the CLI in general. A while back I was working with an intern who as struggling with using distributed linux boxes because all he knew was Gnome: the CLI was utterly foreign to him. So I find it upsetting that this "article" would even be necessary.

<comment><USER7> But if you had to do something _now_ on some alien OS that you didn't know the internals of, wouldn't you prefer a GUI?

<comment><USER8> Contrary to everyone else here: hell yes, every single time.

GUIs are discoverable, and have lower friction for first time users. Example : a video codec GUI will always be easier to use than ffmpeg. I still Google how to use ffmpeg after 10years , and I have to read the entire man page because I don't know _what I don't know_! Is there a newer, better option to this flag available? Like lame for mp3s (another great example), a man page which (used to?) start off with bitrate options, but at the end says; forget all that, just use --preset. Or imagemagick, which decides to go for undiscoverability gold and split their entire program up over multiple binaries so you now get to read multiple man pages! After you guess what the names of those programs are, of course.

Hell. Give me a gui for any unfamiliar task, any time.

Of course, were I encodig movies every day, I'd be singing a very different tune.

Edit: another example: I resize images about once a week and I still have to google imagemagick's convert. I keep forgetting how to resize to known width, keeping height ratio. It's so frustrating that I've just given up and sort of guess with % instead, until it's close enough. Not to mention resizing to a desired file size (is that even possible? With a gui, at least I'd know if it were at all. Now I'm just tired of reading the man page. I give up. Imagemagick wins.)

<comment><USER9> That is more a product of complexity thou.

The other day I was doing some basic data collection and graphing, with the initial version being done in Excel, for something as basic as adding a trendline I had to resort to googling the answer, and following a sequence of several click this, then click this style to get what I needed.

Turns out it was actually easier to understand how to do what I needed using python matplotlib (not a CLI program granted).

Design, documentation and managing complexity are far more important to discoverability than GUI vs CLI.

</comment></comment></comment></comment></comment><comment><USER10> Samba gave me flashback to last week where I had an external drive on my Fedora workstation which I wanted to share with my network... external drive was NTFS. Many hours later, and an setenforce 0 it showed up, but no permanent solution.

That's the usability of common things in everything not major desktop/user OS, and always has been. OTOH, when I'm programming, I would NEVER give up the comfort of GNU stuff. It's just so convenient. Even the editors. Yes, VS Code is great, but oh man - in vim I have a persistent undo with branching, among many many other things.

It's actually amazing how, on the one hand, you have this advanced system for complicated stuff geared towards awesome usability and on the other hand it trips over itself on mundane things which keep it away from the year of Linux (GNU more like it) on desktop.

<comment><USER11> Samba is a "mess" because anything Microsoft is a mess to be compatible with if you are not MS.

That said, sharing files across networks is a hell all its own. In particular if you want something to just automagically appear in some GUI across the office/world/whatever.

Only "reliable" ones are those that require the user at the other end to know what address to enter to get access.

</comment></comment><comment><USER12> /me procedes to launch "youtube-dl -f22 [https://www.youtube.com/watch?v=0-2Ja7T9YF8"](https://www.youtube.com/watch?v=0-2Ja7T9YF8")

<comment><USER13> [https://mpv.io/](https://mpv.io/)

<comment><USER14> AFAIK, mpv calls youtube-dl internally.

<comment><USER13> Yes but it's easier for when you just want to open a link to watch. You get subtitles, audio channels, can skip to the part you want, without downloading the entire video. I think it's DASH but more options are available, it works for Twitch and many other sites (thanks to youtube-dl I guess). With a browser extension you can click on links and open mpv directly.

</comment></comment></comment></comment><comment><USER15> I think there's a version of elinks (or one of the other text based browsers) that can display images if you are running on a framebuffer console

<comment><USER16> Not only that but there are tons of image viewer, video viewer, pdf viewer etc application for framebuffer (for linux). But this begs the question whether framebuffer can be considered "terminal". Also, to me it's still perfectly "terminal", if you use X and run a terminal emulator and live inside it unless you need to see a image, video or pdf. To me, the answer to this question is "yes".

<comment><USER17> The only problem with the framebuffer is that it adds a perceptible delay vs using a "raw" TTY. It's a small delay, perhaps a few ms, and I guess most people can't notice it, but it can be distracting if you live on the terminal.

You can actually see it if you cat a big file to the screen.

</comment></comment></comment><comment><USER18> > Spreadsheets in the terminal: Totally doable.

I disagree. I find vim, mutt and pandoc superior to LO Writer and Thundrbird for text editing and emailing, but sc is just nowhere near LO Calc or even Gnumeric.

I really wish someone would make a text user interface for Gnumeric.

<comment><USER19> Have you tried Org mode tables? They have some spreadsheet functionality, but I'm not sure how big the overlap is.

<comment><USER18> Ok, that[0] does actually look pretty impressive. It can evaluate elisp formulas! Way more advanced that sc.

However, the sad state state of the world is that _other people_ use Word and Excel to edit documents. I wish there was a program that would do to Excel spreadsheets what Pandoc does to Word documents: Letting you edit them in the terminal and allowing you to pass them off to _other people_ in the formats they prefer.

Those _other people_ would hate me if I sent them Emacs Org mode spreadsheets to work on.

[0]: [http://orgmode.org/manual/The-spreadsheet.html#The- spreadshe...](http://orgmode.org/manual/The-spreadsheet.html#The-spreadsheet)

</comment></comment></comment><comment><USER20> Related to this, Omar Rizwan did a great talk recently on file system interfaces:

[https://www.youtube.com/watch?v=pfHpDDXJQVg](https://www.youtube.com/watch?v=pfHpDDXJQVg) (Four Fake File Systems)

</comment><comment><USER21> I used Alpine as my main email client for a while. I really like it, but I had problems with Fastmail's LDAP-addressbook. And if I remember correctly I couldn't use Office365's addressbook either.

Another problem was integrating Alpine with calendars (at least O365).

khal (with vdirsyncer) is a nice calendar app. I haven't got it working perfectly with Office635 yet though; I use a read-only url to the calendar, so I can at least see it, but cannot edit it. The Fastmail calendar works.

<comment><USER22> My solution has been to use the Fastmail website to accept calendar invites, but use khal and vdirsyncer to manager the majority of my calendar. As far as contacts, I believe Fastmail can import and export to vCard, which can be managed locally with khard and vdirsyncer as well. I use khard directly with mutt to access email contacts and I've been happy with it.

</comment></comment><comment><USER23> Having wasted my childhood lurking the (unfortunately stale) KMandla's precious blogposts [0] to find new ways to squeeze functionality out of my EeePC701, I did not really find this video particularly interesting.

Maybe i'm not the target audience.

[0]([https://kmandla.wordpress.com/2010/10/19/howto-switch-to- a-c...](https://kmandla.wordpress.com/2010/10/19/howto-switch-to-a-console- lifestyle/))

</comment><comment><USER24> Will the terminal ever disappear?

I would assume that the percentage of computer users who do significant work in a terminal (email, IRC, coding, etc.) is still decreasing steadily today. What I'm not sure about, how does this decline in penetration compare to the (still real) growth in the worldwide computer user base?

Seems that at least the Internet user base is still growing ~10% p.a. What does this mean for absolute terminal user numbers? I would guess they peaked already a decade ago, with people switching to / starting out with smartphones and tablets instead of notebooks/desktops.

I can also see a world in which a highly disruptive technology (e.g., brain- computer interfaces) would make the terminal redundant once and forever, assuming that the new technology was more efficient/productive than a terminal.

<comment><USER25> Maybe I'm a bit biased by my love for the terminal for most of my work responsibilities--I just can't imagine doing my job without it. Maybe I'm old and things from 10-20 years ago seem recent. Apple deciding to stick a terminal in OSX 20 years ago (a lot of people didn't expect them to include one) helped with the boom of Silicon Valley engineers choosing Apple laptops. PowerShell, first released only 10 years ago by Microsoft with major versions being released every couple years, shows they feel there's a need for investing in Terminals. Windows Subsystem for Linux was first released 2 years ago. While it's technically just compatibility with Linux binaries, I've only seen it being used via a terminal.

You're right, with more and more computer users added every day, as a percentage command line users have probably been shrinking for a long time. But I would also expect in raw numbers they're probably still growing.

</comment></comment><comment><USER26> I really like using the terminal when it makes my workflow faster, using git etc. But checking email and YouTube? No thanks.

</comment><comment><USER27> You know, there's even a text mode display manager for X. I forget the name, but it's on GitHub.

<comment><USER28> lovely

</comment></comment><comment><USER29> How can I watch this YouTube video using just my terminal?

<comment><USER30> This will display the video as ASCII art:

      vlc -V aa <youtube link>

For color ASCII he suggests

      vlc -v caca <youtube link>

<comment><USER31> Ironically, displaying that video with this method will make it unreadable.

<comment><USER4> Well, the OP should have posted it as [https://asciinema.org/](https://asciinema.org/)

</comment></comment></comment></comment><comment><USER32> you probably can make a whole virtual OS running on top of terminal

<comment><USER33> Yes, it was called Windows 95

<comment><USER32> lol, true. probably 3.11 too....

</comment></comment></comment><comment><USER34> I used to use a terminal for everything! And it was a big step forward over punch cards. I remember using my first VT-100 in college, after having taken CS-101 to learn IBM 370 (BAL) assembly language on punched cards. And up until 1988 or so, we were using text terminals for everything, until I got a job at Adobe and started using a Sun workstation. Even then, the windowing environment was used mainly to open terminal windows.</comment>


Why did betting markets get the EU Referendum result so wrong? - <AUTHOR> http://news.ladbrokes.com/politics/british-politics/why-did-betting-markets-get-the-eu-referendum-result-so-wrong.html <comment><AUTHOR> > _The truth is that bookies do not offer markets on political events to help > people forecast the results. We do it to turn a profit (or at least not lose > too much) and in that respect, this vote worked out very well for us._</comment>


Can the Su-25 intercept and shoot down a 777? - <AUTHOR> http://scottlocklin.wordpress.com/2014/07/21/can-the-su-25-intercept-and-shoot-down-a-777/ <comment><USER2> "Certainly the US is responsible for the escalation of the situation in Ukraine."

This seems like the author has an ideological axe to grind. But I guess the technical aspects are interesting.

<comment><USER3> I think he is at minimum at least 25% accurate on that count.

This isn't ideology... it's pretty blatant fact.

</comment></comment><comment><USER4> Putin may richly deserve it, and of course the Ukrainians would rather be European, but it would be willfully blind to ignore that his chain is being yanked.

<comment><USER5> Ukraine is part of Russia and Russia IS European! (Ukraine as as much part of Russia as Alsace-Lorraine is part of France!)

<comment><USER6> Or Savoy of Italy!</comment></comment></comment>


Fermi Space Telescope Fails to See Evidence Of Dark Matter - <AUTHOR> http://www.technologyreview.com/blog/arxiv/26912/?p1=blogs

<comment><USER2> Specifically, fails to see evidence that dark matter is made up of Weakly Interactive Massive Particles (WIMPs) which should annihilate and produce gamma rays occasionally.

Dark matter dominates the mass (90% or more) of all galaxies, not just dim dwarf galaxies. The gravitational aspect of dark matter and is not widely disputed.

Ideally, this experiment would be run on a "dark galaxy" which contains only a dark matter halo and no stars, but we haven't found one yet. The issue with visible galaxies is there may be black holes and other sources of gamma rays created by normal matter.

<comment><USER3> So we have so far no other evidence for dark matter other than the absence of matter to explain the rotation-speed curve of galaxies?

<comment><USER4> Dark matter is not needed to explain the rotation of galixies. <http://arxiv.org/abs/1007.3778> Assuming that paper is true, dark matter is not the simplest idea and by Ockham's razor, we should drop dark matter as known today.

<comment><USER5> Interesting, do you have some reputable links to something dissecting the claims in the paper?

I would have thought mathematical mistakes would have been classed out long ago. Certainly it would have been the first place people looked at the difference in predictions vs observations.</comment></comment></comment></comment>


Show HN: OpenGL-Shader Tutorial in form of a detailed documented sample project - <AUTHOR> https://github.com/MauriceGit/Simple_GLSL_Shader_Example <comment><USER2> Cool! I did a similar thing recently in a literate-programming style. [https://github.com/sampsyo/tinygl](https://github.com/sampsyo/tinygl) [http://sampsyo.github.io/tinygl/](http://sampsyo.github.io/tinygl/)

</comment><comment><USER3> I've been waiting for one of these for ages! Really useful, however I opened several shader files and was disappointed to see the bare minimum implementation with no comments. I would consider the shaders one of the more interesting parts and would really like to see some explanation of them.

<comment><AUTHOR> I will get on it the next couple of days/weeks (exams coming fast...).

</comment></comment><comment><USER4> [https://www.reddit.com/r/opengl/](https://www.reddit.com/r/opengl/) would appreciate this as well :)

<comment><USER5> Can't wait to see when [https://www.reddit.com/r/vulkan](https://www.reddit.com/r/vulkan) goes full out :)

</comment></comment><comment><USER6> Cool. Also check out [https://www.graphics.rwth-aachen.de/page/opengl-primer- sampl...](https://www.graphics.rwth-aachen.de/page/opengl-primer-samples)

</comment><comment><USER7> I think this is great. A WebGL version of this would be great too</comment>


Show HN: Pick – Eliminate the Pain of Scheduling - <AUTHOR> http://www.pick.co/

<comment><USER2> This is great! I was just thinking about something similar, perhaps you'd like to work it in.

basically, it would automatically assign meeting times, based on who's meeting, for how long, except that it would be scheduling several meetings, and take those into account.

I.e. throughout the week various employees in an office would simple set meetings for "friday"

The system would compile all the meetings that take place, and schedule them, to the best of their ability, so that no two meetings would conflict. On thursday night, the times are finalized and the meetings are placed on attendees calendars.

You'd need some sort of conflict resolution, but if you ran it each time for each meeting request came in, you could alert the involved parties immediately.

<comment><AUTHOR> Thanks for the idea! Definitely something to think about incorporating into the app.

</comment></comment><comment><USER3> Love this! A simple solution to a serious pain in the &^%$. Will become one of my goto apps. Thanks guys!

<comment><AUTHOR> I'm glad you love it! You're welcome!

</comment></comment><comment><USER4> [http://lifehacker.com/pick-makes-scheduling-times-to-meet- or...](http://lifehacker.com/pick-makes-scheduling-times-to-meet-or-just-hang- out- ea-1688947349?utm_campaign=socialflow_lifehacker_twitter&utm_source=lifehacker_twitter&utm_medium=socialflow)

</comment><comment><AUTHOR> Pick eliminates the pain of scheduling by surfacing mutual availabilities between 2 or more users. Users also get a personalized link so they can share their available times with anyone.

</comment><comment><USER5> This looks like a good combination of simplicity and magic. I'm not sure about the focus on mobile, but pleased to see the website is simple as well. Looking forward to trying it.

<comment><USER4> Founder here. So many people are on the go and using their phones. Pick makes it easy to schedule on the go, something that many people don't do right now. Web is just as important because Pick has the unique link you can share with anyone. Any feedback you have after trying it would be great. michael [at] pick.co</comment></comment>


Wikipedia: Reduplication - <AUTHOR> https://en.wikipedia.org/wiki/Reduplication <comment><USER2> Linguists have a word for everything.</comment>


Inside the Lego Factory - <AUTHOR> http://gizmodo.com/5022769/exclusive-inside-the-lego-factory <comment><USER2> As a 7 year old I wrote to "Jim'll fix it" (UK TV program), asking to go and see a Lego factory. They never replied :( Glad to have finally seen how it all gets made!

</comment><comment><USER3> Awesome video! I have a really old book that illustrates how legos were made back in the day, but this factory looks serious! Lego is still as big as it ever was.

</comment><comment><USER4> If anyone is interested in these, take a look at Anchor Stone Blocks. I remember playing with them when I was younger and greatly enjoyed them. I think they can potentially be a lot more creative since they do not interlock at all and let you create whatever you want.

<http://en.wikipedia.org/wiki/Anchor_Stone_Blocks>

</comment><comment><USER5> Those videos are gorgeous! Highly recommended.</comment>


Open Forensic Science in R - <AUTHOR> https://sctyner.github.io/OpenForSciR/ <comment><USER2> The principal chapter headers are:

        2 Validation of DNA Interpretation Systems

        3 Firearms: bullets

        4 Firearms: casings

        5 Latent Fingerprints

        6 Show Outsole Impression Evidence

        7 Trace glass evidence: chemical composition

        8 Decision-making in Forensic Identification

I have no interest in forensics at all but I think my evening is gone. This is truly nerd snipping material.

</comment><comment><USER3> 7 of the 8 authors listed are women, pretty cool.

<comment><USER4> Anecdotally, it has been my (limited) experience that the Forensic Sciences are dominated by women, in terms of the makeup of the average lab at the academic or state/federal level. Academic programs seem to show this trend as well:

[https://news.psu.edu/story/276199/2013/05/07/research/probin...](https://news.psu.edu/story/276199/2013/05/07/research/probing- question-do-women-dominate-field-forensic-science)

[https://www.tandfonline.com/doi/abs/10.1080/1940904080262974...](https://www.tandfonline.com/doi/abs/10.1080/19409040802629744)

[https://www.sciencedirect.com/science/article/pii/S2589871X1...](https://www.sciencedirect.com/science/article/pii/S2589871X19301305)

Source: Worked in a forensic genetics laboratory during my undergrad, and some of my best friends are forensic scientists.

</comment></comment><comment><USER5> It's always nice to see an interesting and quality R package.

</comment><comment><USER6> I have a feeling the seeds of several mystery novels will be laid tonight.

If the Times — years from now — hails anyone as the Agatha Christie of R analysis, I'll think back to this article.

</comment><comment><USER7> Related: Digital forensic: Evidence analysis via intelligent systems and practices. European project COST (cooperation in science and technology) [https://www.cost.eu/actions/CA17124/#tabs|Name:overview](https://www.cost.eu/actions/CA17124/#tabs|Name:overview)

</comment><comment><USER8> I had a look around, but I don't think there are any sources for Forensic Data that are publicly available.

I don't know of any resources where data that has been extracted from some crime scene(s) can be downloaded.

How could one build on their knowledge after going through this resource if they would like to?

<comment><USER9> One good source might be NIST. Here's an open access ballistics dataset: [https://www.nist.gov/programs-projects/nist-ballistics- toolm...](https://www.nist.gov/programs-projects/nist-ballistics-toolmark- database)

Edit: I should have looked at the linked book first, since this dataset is listed in Ch3. Oops.

</comment></comment><comment><USER10> Sometimes you don't know what you've been missing until you are shown. This is one of such things. Only thing that could possibly make it better is chapter on bloodstain pattern analysis.

</comment><comment><USER11> Figure 2.1 is a nice graphic illustration of how to make a tidy/long form dataset from a wide format dataset. Nice!

</comment><comment><USER12> Is R commonly used in forensics?</comment>


Show HN: Procedural thunder and lightning in JavaScript - <AUTHOR> https://github.com/wybiral/storm <comment><AUTHOR> For anyone curious, the thunder audio is created on-the-fly here: [https://github.com/wybiral/storm/blob/master/js/index.js#L22](https://github.com/wybiral/storm/blob/master/js/index.js#L22)

Basically it creates a "boom" from brownian noise and then decays out the higher frequencies.

</comment><comment><USER2> Just had a heart attack due to the surprise of noise coming full blast from speakers on full volume. Thought that thunder/lightning was visual.

You might want to ease in the noise volume.</comment>


Ask HN: What would you do with a Google Mini? - <AUTHOR>

I have a mint-condition, never used rack-mountable Google Mini search appliance from 2007. Model # MINI-0020.
http://www.google.com/enterprise/search/mini.html
The process by which I spent $2900 for it only for it to sit idle is embarrassing to recount. But let my shame be your gain. Use it for a client, or open it up and hack it.
It can be yours for $350, and I'll take Visa/MC - you'll have the same protection as if you ordered it online (read: the ability to dispute the charge in case of non-delivery).
Thanks. <comment><USER2> do you have a macbook pro? I really need one, new or used</comment>


Let Postgres Do the Work (2013) - <AUTHOR> http://sorentwo.com/2013/12/30/let-postgres-do-the-work.html <comment><USER2> At work, we have an internally generated report that was done purely in ruby. It worked, barely, munging numbers for about 1000 records. When we hit 4000 records, the report took about 6 hours to run in ruby.

We looked for some obvious optimizations like eager loading and some map reduce magic and implemented them. That brought us to a range of 45 minutes to 2 hours.

We decided that it was still not good enough. We moved ALL of the report into SQL functions (Postgres) and we have the whole function running in 27 seconds.

I agree with some of the top comments that maintaining this is a little trickier than ruby code, but some ideas we came up with in maintenance: 1) Write the SQL in a ruby file that has a class method of sorts that returns the generated function. This allows for version control to track the changes of the sql function. 2) Focus on tests at the interface level. We had great test coverage on the end result prior to moving to SQL. We were able to re utilize those tests to verify accuracy with calculations that are now in SQL.

This really isn't for everyone, but for those that want to try something new, it is worth it.

<comment><USER3> I once reduced the running time of a report from 45 minutes to 3 seconds (900x improvement) by moving the code inside the database.

If a programming language wants to stay fast it must eventually become a database. I realize this is an unpopular opinion but popularity is the wrong metric to judge by.

<comment><USER4> Hence Kx, ZODB.

<comment><USER5> I'm not too familiar with ZODB, but it looks like it tries to impose OO on a database, while in reality relational model works best with data, so making programing language able to interact with data that way would be better. I think something like JOOQ[1] is close to that.

In order to get good performance you want to minimize number of back and forth requests over network. So instead of making a request to obtain list of items, and then fetching each of the item one by one (so called N+1 select issue) you will get a better performance if you make the database send only the data you want, nothing more, nothing less.

[1] [http://www.jooq.org/](http://www.jooq.org/)

<comment><USER4> > I'm not too familiar with ZODB, but it looks like it tries to impose OO on a > database, while in reality relational model works best with data, so making > programing language able to interact with data that way would be better.

ZODB itself is essentially a transactional single-object store, where that "single object" is usually the root node of an arbitrary (possibly cyclic) object graph. Storage depends on the backend, nowadays you'd usually use file storage for development and relstorage for any kind of deployment.

It doesn't have any query language, Python is. There are no indices beyond those that you explicitly create (eg. a dictionary would be a simple index, but other packages provide more complex indices, like B-Trees - the nice thing here is that anything that goes into the DB is fully transacted, which removes a lot of headache that you'd have with other solutions (eg. flat XML files)).

ZODB thrives when your data model is too complex to easily or efficiently map into SQL, when you don't do or need efficient complex ad-hoc queries and when 180 % performance and concurrency (although this was recently improved through the MVCC reimplementation) isn't the highest priority. Since it's pretty good at caching (much better than most ORMs) performance usually doesn't suck.

</comment></comment></comment></comment></comment><comment><USER6> This is an example of what I call "embracing PostgreSQL". Roughly speaking it means ditching the ORM layers and using a simple API to run any SQL query that you can think up. Then your application can leverage the many features that exist in PostgreSQL and not just treat it as a dumb SQL server.

Using functions as an intermediary to raw queries, also decouples the SQL details from the application. What I mean is that if the application calls an SQL function to read, update, insert data then you can revise the SQL functions independently of application code. In other words, if you refactor an SQL function, you can deploy the change to the database without rebuilding and deploying the application.

This is especially helpful in companies that have an onerous verification and validation process for application changes, because often "performance improvements" are classified as administrative changes which can be done with less bureaucracy.

So, embrace PostgreSQL as a permanent part of your application and reap the benefits of its many powerful features.

<comment><USER7> As someone who's thought about embracing over using the ORM, here's a couple issue that come up:

\- Version control. The SQL functions end up just being data in your DB. This feels like an anti-feature in the world of continuous integration and code review.

\- Lack of composability. An ORM gives you the ability to easily compose filters. This lets me write functions like "take this query, and make sure it's properly filtered down to one user's data". Because of how SQL works, each query needs to be hand-crafted, and it's hard to make parts of it generic.

\- Rewriting business logic. I have business logic in Python already, but if I want to query off of that in the DB in SQL, now I need two implementations. You can sort of get around this in an ORM by annotations.

\- I'm not sure what the developer tooling environment is like. PyCharm is pretttty nice.

To be honest, you citing that it's easy to get around the validation process when using Postgres is a major red flag. Why would I want to circumvent code review for things that are most undoubtably code?

<comment><USER8> The right way to have composability in a RDBMS is with things like parameterized views or table-valued functions. This would fall under embracing the RDBMS, leveraging its modern capabilities.

</comment></comment></comment><comment><USER9> I had to work on/with a rather large backend which used this approach. Most of the logic was in stored procedures, with python/sqlalchemy used as a glue and to process requests.

It was absolutely horrible to develop and a nightmare to test.

For one, there's nothing approaching ActiveRecord migrations in stability and ease of use, so schema changes on dev/test/deploy were a huge pain. Then, you can't really work in normal "auto-run tests on save" mode as you would with saner frameworks, syncing source from git to postgres is needed (the principal dev altogether preferred to edit directly in pgadmin and then sync). Then, SQL tends to be a lot harder to read than python/ruby, especially so if not well documented and with many join tables. And finally, you can't scale out the heavy stuff, you are limited by your master instance basically. 2/5, would not recommend.

<comment><USER2> With the correct abstractions, you can definitely run tests on save.

SQL is rather readable these days. It's obviously not as easy to read as ruby or python and is slightly more verbose, but it is certainly readable.

Mileage will vary of course. There are cost/benefit trade offs with every architectural decision made.

<comment><USER10> > SQL is rather readable these days. It's obviously not as easy to read as > ruby

As someone who can't read Ruby but can handle "any level" of SQL fluently, that's obviously not a very objective statement.

<comment><USER2> I made a very broad assumption based on my past experiences with engineers and I apologize if I offended you.

Most engineers I have met in my career have really depended on an ORM to do all of their heavy lifting. They can write some of the most eloquent ActiveRecord queries but would be unable to create the same functionality using raw SQL.

Again, deeply sorry if I offended. It was not my intention.

<comment><USER9> Wow, is this really the norm? I mean, not knowing SQL and working purely with ORM. This seems weird to me, as I learned SQL first.

<comment><USER11> Yes, that's definitely the norm. Having some experience with Rails, I'm pretty sure that 90% of Rails developers have never written any SQL. If they need to access the production database, most of them would use the rails console on the production app server instead of psql etc.

And I can sympathize. For example, I wouldn't even know how Rails maps a many- to-many relation to SQL tables, so I would have to use the rails console myself to traverse such a relation.

<comment><USER9> Although Rails is very reasonable with its mappings and they are easy to use directly, I prefer Rails for db manipulaton, it is usually much easier and faster to type 'User.find(1).favorites << Product.find(10)' than an equivalent SQL.

<comment><USER12> Very true, but I've found that it's easy for those ActiveRecord abstractions to kill performance (I did this on a dashboard that was performing some serious calculations across hundreds of millions of records, often joining other similarly sized tables)

</comment></comment></comment></comment></comment></comment></comment></comment><comment><USER13> Cool demonstration of IMMUTABLE functions (TIL), but there's a reason people have moved away from stored procedures/functions in RDBMSs in favor of moving this stuff into much slower application code -- you now have business logic living inside of the database. From there, you have to now think about how this affects:

\- Testing

\- Deployment/Migrations

\- Day-to-day tooling to work on it

\- Switching costs (mental overhead, using multiple languages)

\- Documentation

\- Probably more stuff

The ruby code is just like all of your other ruby code and can be grokked and worked on by anyone who is up to speed on your ruby stack. The DB function meanwhile requires jumping through lots of hoops and will always feel like a second class citizen relative to the vast majority of your application code, unless you do a lot of work and maintenance (unlikely to happen without feeling distracting if this code is a relatively small slice of your code base.)

In some cases, this can be worth it for massive optimization wins. But the article doesn't really touch on why this might be a bad idea.

I do think it highlights the potential of systems like MADLIB [1] where you can push the data crunching into the database, while having that be abstracted away in your primary programming language (in this case, R.) One could imagine a world where you wrote the ruby code and it was somehow mapped in to be run on the database. But that's not the world we live in today unfortunately. It's really a shame, because people using a database as capable of PostgreSQL but with a fairly dumb ORM on top are under-utilizing its potential, for sure, but there's not really a great path afaik to leverage it. (I remember years ago MS introduced running C# inside of SQL Server, I am not sure if that ever ended up panning out into being something smarter than the dumb "upload code to database manually" model we are used it.)

[1] [http://madlib.incubator.apache.org/](http://madlib.incubator.apache.org/)

<comment><USER14> I may be in the minority here, and I'll happily accept that if I am. But my rule of thumb is that anything that can be done inside the database should be done inside the database.

But I'm a python/C#/.Net person.

The stored procs/functions go into a repo just like everything else does. It's not that big a deal. Alembic for migrations is pretty solid. And if you're dealing with a large code base, you log changes inside the DB itself. Use the database for version control.

It's really manageable. It requires that your dev team really knows SQL. But I don't think that's a bad thing.

It's fast, gets the job done, and if you're running a language that doesn't make it easy to deal with concurrency, it's nice to just let the database handle transactions.

For everyone who isn't facebook or google, this is the way to go, in my experience.

Let the db do the hard work, let your preferred language be the middleman, and have a reasonable front end framework do the presentation.

I can scale a web app to millions of users on a couple hundred bucks a month of hardware with this approach. You can too.

<comment><USER15> > my rule of thumb is that anything that can be done inside the database > should be done inside the database

For non-distributable (or at least non-multi-master) DBs, you are often using your most expensive and least distributable resource to do your cheapest and most distributable work. My rule of thumb is that unless you need atomicity or the performance (as profiled) makes a real difference, do it outside the DB. Also has the side effect of avoiding system lock-in (at the expense of language lock-in which I think is ok).

Granted, it's subjective, but I've had the most trouble scaling DBs than other systems, and it's usually CPU/mem of business logic pushing the boundaries.

<comment><USER9> Exactly, you really need ACID only for important stuff, other data you can cache on workers where you run most of the logic

<comment><USER16> If you're doing reports you could run them against a read-only slave.

</comment></comment></comment></comment></comment><comment><USER17> At my last job we finally got our front-end devs to move all client side db work to calls to stored procedures or views. After doing so, nearly all of them fell completely in favor of this method. This is escpecially true with large, complex DBs or data warehouses, where the model is subject to change and reliance on back-end devs better knowledge of the database is more important.

That said, despite some of the tradeoffs - for example with testing, or migrating to a new db (which is extremely rare anyway) - it is ultimately far better for client code not to have to know back-end implementation. I think things like graphql are finally making this abundantly clear.

What I have been dying for is a real time DB BAAS that is ACID compliant, preferably relational, has a simple rest api, and allows me to write stored procedures that I can call from my client code. Horizon is probably the closest thing out there. Right now using firebase, and sick of the absurd amount of client side code I have to commmit to to pull data from various parts of the database. Requires huge amounts of overfetching, unecessary coupling of client-server code, horrible consistency support, overly loose type structuring, etc.

If somebody writes a postgres version of horizon I will pay big money to use it :)

<comment><USER18> Doesn't include everything that Horizon does, but it provides a good foundation for building it [http://postgrest.com/](http://postgrest.com/)

<comment><USER17> Cool, hadn't seen that. There is also postgraphql, which I have become a big fan of and is a great foundation:

[https://github.com/calebmer/postgraphql](https://github.com/calebmer/postgraphql)

That said, the real-time aspect is what I'm really dying for, plus a company supporting a BAAS. The ease of firebase is so nice, and you can make really cool real time apps with it very fast. I'm not sure if switching to a relational model would make impose some technical limitation that json stores don't (besides obvious complexity). Postgraphql + socket.io is kind of what i'm thinking is the start

<comment><USER19> Some clever use of NOTIFY might help with real-time? It's basically publish/subscribe directly in Postgres itself, but I've never actually used it.

<comment><USER17> I had forgotten about this actually. Thanks for the reminder :) Curious if anyone has tried using this for real time apps and what their experience was

<comment><USER18> Unfortunately NOTIFY doesn't work across nodes.

</comment></comment></comment></comment></comment></comment><comment><USER20> The article makes a good point that if you want ordering by a computed 'ranking' to be performant, your database will need to store and index that value.

But then it takes another leap and says that this means your database should actually _compute_ that value. I don't see why that's necessary, and it would bring with it all sorts of issues that other people have mentioned (maintainability, scaling, testing, coupling).

It seems you could equally solve the problem by adding an additional indexed 'ranking' column, and computing and storing the value at the same time you insert the row [1]. It seems that's essentially what Postgres would do anyway.

Also, I'd note that the algorithm here is very simplistic, and even so, the author had to make a _functional_ change in order to get it to be performant in Postgres. You can't just substitute an ID for a timestamp, just because both are monotonically increasing. The initial Ruby version of this algorithm treats a given 'popularity' as a fixed jump in some amount of time (e.g. 3 hours). The Postgres version treats it as a fixed jump in _ranking_ (e.g. 3 ranks). Those are not equivalent.

[1] This does assume that you can control all the database manipulation from a centralized place.

<comment><USER11> > It seems that's essentially what Postgres would do anyway.

Yes, but if Postgres does it, it's literally impossible for the developer to screw up, whereas manually putting the ranking in the table can easily cause inconsistent records if you don't know what you're doing.

And even if you know what you're doing, next month's code change might not remember that it's important to update the ranking with the rest of the record (unless you're calculating it in a before_save hook or something).

</comment></comment><comment><USER21> I tried doing this, but I found it hard to maintain as it needed more slaves to cope with the load of the complex functions. Also, it was harder to tweak the algorithm for things like "increment the score by x in case y, otherwise increment by z". I guess it's possible, but I just found it too hard to work with.

For me, it was easier to use Redis to keep a sorted set of article IDs. I updated the scores in my application code using Redis native functions, and then got a slice of IDs for a `SELECT ... WHERE IN (ids, from, redis)`.

It's probably because I'm a rubbish database engineer, so stick with my strengths.

<comment><USER22> > It's probably because I'm a rubbish database engineer, so stick with my > strengths.

This doesn't make you a rubbish database engineer. Scaling databases is complex, so it makes sense to have your source of truth database do only the things it must do (consistent updates, indexing the ranking value if needed for queries) and things it's good at, and move everything else (calculating the ranking value) to another part of your system. If you can keep database load low enough to avoid sharding, that's a big win; you don't have to not grow your DB, just grow slower than Intel grows CPU performance / accessible RAM.

</comment></comment><comment><USER23> PostgreSQL Stored Procedures can absolutely be a pain to manage and change management can be tricky. Having said that these are not problems without solutions and there are some good wins if you can be organized enough to pull it off.

First off, plan and organize things. Yes, it would be nice if there were another level of abstraction, like Oracle's packages, but you can use schemas a bit more freely for namespacing. But a little time thinking instead of just coding can avoid much of the spaghetti. Many good devs will think through the rationality of their APIs, this is no different.

Second. Use a tool that lets you manage the code-bits like code. Migration tools like FlywayDB, etc. are not good for this because they sacrifice too much to the stateful nature of the database: you end up organizing things on a timeline rather than based on your structure. A better approach is like the one in Sqitch ([http://sqitch.org](http://sqitch.org)) where you organize files according the organization of the database rather than the history of the database... very powerful approach. There are also verify steps which can incorporate testing: and testing the store procedures is easy... it's maging the data in tables across tests that can be hard and that is true regardless where your business logic lives (insofar as those tests can change data).

Third there are good testing tools available: The guy that made Sqitch also makes pgTAP ([http://pgtap.org/](http://pgtap.org/)). Well worth a look. I haven't done much myself with this one, but will likely do so soon.

</comment><comment><USER24> I've written about this before [1] but i think the higher level message here is about Ruby on Rails developers expanding their database understanding and/or reliance. Given how cleanly ActiveRecord abstracts database porcelain, many devs who started with Rails don't lean on the database enough.

This, along with validators, table indexing and foreign keys are some of the more common shortcomings i see in devs who learned on Rails.

1: [https://blog.benroux.me/be-the-better-rails- developer/](https://blog.benroux.me/be-the-better-rails-developer/)

<comment><USER25> When you're starting out, you don't need these optimizations. Depending on what you're trying to do, you may never need them, and instead find that a caching solution is best.

<comment><USER26> Data integrity isn't an optimization.

</comment></comment></comment><comment><USER27> What is the performance impact on INSERT when using tables with complex indices like the one mentioned in the article?

<comment><USER28> I'm not the author but I'd guess almost nothing. Basically you just need to calculate the result of the function and index it by the result, should be almost completely unnoticeable.

<comment><USER29> Unless it's a table with high write load. You're basically shifting the expensive part from read time to write time.

</comment></comment></comment><comment><USER30> For version control, I put .sql files right alongside my other source code, and check them in. I might try snippets out interactively, but after a statement grows so long that it wraps a couple of times, I usually move it to a text file and edit from there. I run it in psql with the \i command:

       psql> \i test.sql

Usually I have one terminal window for the text file opened in vim, and another window for psql where all I do is keep running "\i test.sql".

When the code is polished and ready to go live, I turn it into a view or function and move it into a permanent file (views.sql, functions.sql, ddl.sql, make.sql, or whatever you want to call it). This file can be run as many times as I want, idempotently. This is because it starts off dropping all the views or functions that it later defines. You can try instead saying "CREATE OR REPLACE . . ." but PostgreSQL only lets you replace a view or function if its outer appearance stays the same (for views, the output columns can't change; for functions, the input and output can't change). So I find it simpler to just drop all of them ("DROP TABLE foo IF EXISTS...") and then create them (You usually have to drop them in the opposite order you create them, if any depend on one another). I wrap the whole file with BEGIN and COMMIT, so if there is any error the whole thing aborts. Actually I wrap it in BEGIN and ROLLBACK, and run it to see if there are any errors. Only when it's solid, polished, and error-free do I temporarily change ROLLBACK to COMMIT, run it, and immediately change it back to ROLLBACK. The file that gets checked into version control ends in ROLLBACK, for safety.

Later if I want to change something, I always do it first by editing the .sql file and then running it from psql. Then I check the changed file into version control.

\---

For views and functions this is easy, because they don't keep their own data. You can drop and recreate them at any time. For tables, it's a little more complicated. You can't just drop and recreate them, or you'll lose all your data. So for tables I keep their definitions in a separate file. I run this file at an app's inception but seldom afterward. If I need to make a change to a table, I do it interactively, in the command-line tool ("ALTER TABLE foo ADD COLUMN blah ..."). Then I will probably edit the tables.sql file to reflect the change, just so it's in version control. But it's up to you. You can always pull the table definition from Postgres with the pg_dump command.

</comment><comment><USER31> its often much easier to scale via app "farms" then to scale the db backend. Sometimes db procedures can lower the total db load, but be careful letting the db do too much work.

</comment><comment><USER32> I thought the point of using an ORM like Active Record was to decouple the business logic and the database?

<comment><USER33> It can decouple you from the specific database implementation. The ORM can generate SQL that targets the database you are using by altering the generated queries to account for dialect and feature differences. For example, it can, potentially, make it possible to switch your application from using MySQL to PostgreSQL rather seamlessly. However, in my experience, this is rarely straightforward, and rarely done. It's not unusual for the application layer to become dependent on some quirk or unique feature of the underlying database, and sometimes that dependency is not obvious. The sibling reply is not far off the mark when it comes to using ORMs "in practice".

</comment></comment><comment><USER34> In one of my gigs, it was normal operating procedure to put logic in sprocs and call out to that from elsewhere. It makes so much sense - RDBMS engines are good at doing math, so we should let them do as much math as possible. ORM layers hide that away, and thinking about these problems in Ruby or Python work, but those languages just aren't as good at plain math as a database can be. I've done this type of thing in Rails and Express apps, and it makes complete sense there. You can even keep the sproc in source control by creating and changing them as migrations. It's tops.

</comment><comment><USER35> "We can replace the timestamp with the primary key for the "recentness" calculation". Very different properties, not a great replacement.

<comment><USER36> I definitely agree that there may be some unexpected consequences of using the primary key in this way. It certainly won't behave like a timestamp and could distort the function outputs.

Would it be possible to substitute the integer count of seconds since epoch (or some other arbitrary base timestamp) and use that instead? Then you'd still have an immutable function to satisfy the index, but also you'd preserve valuable information about the relative time intervals between posts.

</comment></comment><comment><USER37> The idea is: Compute where your data is and yes data do have a location when computing has to be done with physics(computer).

</comment><comment><USER38> >The integer value of a timestamp is just an increasing counter, ticking off each microsecond. The database itself has another form of increasing counter, the primary key.

This observation is either profound or trivial, depending on the mindset. The hundred-fold improvements it brings (along with the immutability) are not trivial, by any measure.

</comment><comment><USER39> Is it really needed to declare separate functions with all that boilerplate just to multiply and add a few numbers in an SQL statement?

<comment><USER40> No.

</comment></comment><comment><USER41> The future is this but backed with super cool FDW for s3 and bigtable

</comment><comment><USER42> what happens if i got 10 posts then before getting the second 10 one of the posts that i should get in the second query got 50 likes, it will got higher ranking and i will miss it, right?

</comment><comment><USER43> he mentions 'logarithmic clamping' towards the end, can someone provide a link to what that is? google-fu failing.

</comment><comment><USER44> I think ~0.442ms is very slow for a social media web or app, considering that it's only 1 query, maybe that example isn't the best for that kind of queries

</comment><comment><USER45> It's unbelievable that an article can get to HN front page in which the author doesn't know the difference between Rails and Ruby. So annoying!

This is NOT Ruby for God's sake:

        SYSTEM_EPOCH   = 1.day.ago.to_i

<comment><USER46> People are downvoting I think because this is a rather pedantic point to be annoyed by. The tone is one of superiority, rather than pointing out the simple mistake.

Calling a rails function a ruby function is unlikely to invalidate the entirety of the article.

<comment><USER45> I know the point is somewhat pedantic, but I just don't really like to learn from people who doesn't even know what is what. Somewhat invalidates the article IMO, but I read it anyway, just with very carefully, trying not to learn anything just understanding the basic idea he/she want to tell.

I think they downvote because they are so ignorant I can't even believe it.

<comment><USER47> Perhaps they are downvoting because of your own ignorance? The aforementioned code does depend on ActiveSupport (or similar library), but has absolutely nothing to do with Rails.

<comment><USER45> Thanks for explaining!

</comment></comment></comment></comment></comment><comment><USER41> Speaking of this i'm looking at hiring someone to do some OSS rust/postgresql work. Namely writing FDW for s3 and bigtable.</comment>


Ghost 0.5 milestone release - <AUTHOR> http://blog.ghost.org/ghost-0-5/

<comment><USER2> I love the idea behind Ghost because they are building a proper next-gen blogging platform beyond the wasteland of all the blog/CMSs of the 2000's that saw Wordpress come out on top.

It's like they learned from all the mistakes of the past and are building something future-oriented minus the bloat that came with the iterative development of Wordpress

</comment><comment><USER3> All kinds of awesome stuff in this release, thanks Ghost team!

Still sad that apps didn't make it into 0.5 as planned, but the API and the new admin screen make up for that.

<comment><AUTHOR> Yes, this is the release that will get me using Ghost. I've been waiting for them to introduce multi-user blogs for a while.

</comment></comment><comment><USER4> I've been using ghost on [http://christopherbull.name](http://christopherbull.name) for a while. It's great. Initially it was a middleman site, but that just requrired too much code to get setup. Hosted ghost is perfect for what I wanted: A simple place to write.

</comment><comment><USER5> It would be useful to have something on the home page to tell the prospective user "Why use Ghost and not WordPress, or X, or Y".

<comment><USER6> I would settle for an Import from WordPress tool.

</comment></comment><comment><USER7> I have been unsuccessful in finding a demo of the new default theme. Is that available anywhere?</comment>


Teach whether you know what you're doing or not - <AUTHOR> http://excid3.com/blog/teach-whether-you-know-what-youre-doing-or-not/

<comment><USER2> Great post. I completely agree especially with the fact that "Teaching makes you learn".</comment>


Show HN: Simple cryptocurency prices info chrome extension - <AUTHOR> https://chrome.google.com/webstore/detail/crypto-panel/edmfefhgemipfljchhlalhoebfpcikch <comment><USER2> Hi there,

the first impression is that this is a nice tool with a design well done. What disturbed me a little was that zooming and scrolling of the chart was not really intuitive.

Also, I prefer to watch the crypto price in EUR, feel free to consider adding other currencies as well.

If you are interested in more UX feedback, feel free to visit [https://usability.testing.exchange](https://usability.testing.exchange) which is a free community platform built exactly for this purpose.

Good luck! Bernard

<comment><AUTHOR> Ok thx for feedback, will add euro easily..

You think bottom scrollbar like this could help with scrolling [http://jsfiddle.net/gh/get/library/pure/highcharts/highchart...](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/demo/navigator- disabled/)

?

And this one with zooming [http://jsfiddle.net/gh/get/library/pure/highcharts/highchart...](http://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/demo/scrollbar- disabled/)

p.s. [https://usability.testing.exchange/](https://usability.testing.exchange/) \- nice one

<comment><USER2> I like the way charts are implemented on coinmarketcap.com.

It's a combination of the second proposal of yours, but it's also complemented with zooming by clicking directly on the chart itself.</comment></comment></comment>


Haskell Game Server – Part 2 - <AUTHOR> http://mojobojo.com/posts/2016-01-01-haskell-game-server-part-2.html <comment><USER2> 69 points and growing - but nobody has anything to say about it. at the end of the day this is anyway just yet another post about how you can actually do something practically relevant with Haskell :D

How about this: "PHP Game Server". Nobody would care because PHP is just one of those stupid languages mostly known for being (merely) useful ;)

<comment><USER3> There are several reasons for this.

Haskell posts tend to be quite factual or tutorial in nature. There generally isn't a lot of room for debate or disagreement. This is in opposition to posts about coding style, tech politics, etc., which make up a large portion of posts on HN and garner a lot of comments.

Haskell posts tend to cover more advanced topics. People read the post, learn something, and then don't have anything to contribute because it's new information to them.

On the same note, a lot of people think Haskell is cool but haven't learned to use it yet, so they don't have any feedback with regards to libraries, technique, etc.

<comment><USER4> I think you hit the nail on the head three times in a row. All apply for why I didn't comment. Something special about the Haskell community to achieve that on a regular basis, eh?</comment></comment></comment>


LwIP on BareMetal: Lightweight TCP/IP stack running on ultra-lightweight kernel - <AUTHOR> https://github.com/ReturnInfinity/BareMetal-lwIP <comment><USER2> > are written entirely in Assembly for optimal speed, simplicity, and > manageability of the code

So not optimized for safety.

<comment> loup-vaillant I want a Coq kernel!

But seriously, I'm not sure writing the stuff in assembly can also optimise simplicity and manageability. Though we _are_ talking about the obsolete X86 architecture here. More reasonable hardware[1] will likely be easier to compile to.

[1]: [http://millcomputing.com/](http://millcomputing.com/)

<comment><USER3> There is seL4

[http://sel4.systems/](http://sel4.systems/)

</comment></comment></comment><comment><USER4> It seems like a strange match to use LwIP (which is optimzed for small size to run on embedded systems) with a kernel optimized for speed. I'm guessing that a different IP stack would perform better, given the different constraints on a x64 system. Maybe there aren't many to choose from though, that aren't tied to a specific kernel?

<comment><USER5> You can use the NetBSD stack[1] on baremetal/in userspace/wherever.

[1] [http://rumpkernel.org/](http://rumpkernel.org/)

<comment><USER6> Yeah, exactly. NetBSD's implementation makes sense to use, as it's a rather solid one and very portable. Plus it's probably very general-purpose, while lwIP had never been. Not to say that general-purposeness is the best thing, so that's why I pointed at mTCP, which is actually optimised for multicore systems... Anyhow, I don't think these guys even get their point across. Why have they chosen lwIP in this particular instance actually?

<comment><USER5> Yes, lwIP only has smallness as a benefit, at the expense of a lot. If we knew what the idea behind the thing was it might be clearer, performance does seem to be an aim.

</comment></comment></comment></comment><comment><USER7> Is it just me, or isn't "BareMetal OS" an oxymoron? I guess it sounds cool, but taking an established term and use it as a name for the exactly opposite seems confusing to me. Please be responsible when choosing names for your projects :)

<comment> loup-vaillant Exokernels don't, actually, abstract over hardware. They merely manage resource allocation.[1] So, "BareMetal", is not such an oxymoron, provided you're talking about the kernel itself.

[1]: [http://c2.com/cgi/wiki?ExoKernel](http://c2.com/cgi/wiki?ExoKernel)

</comment></comment><comment><USER8> I love minimal things. But if this is supposed to be more than a because-we- can-thing, tell me if it is worth the trouble - how fast is it, how many requests can it stand? Numbers! Ten times a stock Linux setup? More? Less?

<comment><USER9> Speed does not matter much. Does it work in the wild? A TCP/IP stack developed from specifications would work very well if you dropped it on the Internet.

</comment></comment><comment><USER10> What about using a more modern, future-proof TCP/IP stack like PicoTCP? [https://github.com/tass-belgium/picotcp/](https://github.com/tass- belgium/picotcp/)

<comment><USER6> Maxime, that's what I was thinking too! But nobody know what these guys are doing, as you can see above...

</comment></comment><comment><USER11> This reminds me of Mirage OS[1], which is written in OCaml. Although they call it a Unikernel and it runs on top of Xen.

      [1]: http://www.openmirage.org/

</comment><comment><USER6> To me this is not as appealing as OSv [1], is BareMetal OS even made for the cloud or more for embedded systems?

[1]: [http://osv.io/](http://osv.io/)

<comment><USER12> Not really for embedded systems. Because the majority of the embedded systems is either ARM or proprietary Freescale, Renesas, you-name-it architecture. But BareMetal OS seems to be exclusively for 64-bit x86. It is also proud to not be generic. So: no, not for embedded.

</comment></comment><comment><USER13> "The kernel, as well as its various device drivers, are written entirely in Assembly for optimal speed, simplicity, and manageability of the code."

I love it !!!

<comment><USER6> Why have they not written the TCP/IP stack in Assembly then?

<comment><USER14> Because they didn't write it, someone else did

</comment></comment></comment><comment><USER15> I wonder how it compares with seL4 ([http://sel4.systems/](http://sel4.systems/)) which is verified, open source, "bare metal" and designed for minimality, security and performance.

</comment><comment><USER16> Reminds me of KA9Q.. I wonder how many old systems from the '80s could find new life in all these quests for IOT on small MCU's?</comment>


Google Code-In winner whose Cameroon hometown is cut off from the internet - <AUTHOR> http://www.bbc.co.uk/news/world-africa-38922819 <comment><USER2> Some of you guys have no idea how lucky you are to have good, fast and reliable internet.

I've been around computers since 1998 and it's been 4 weeks since I have a good enough internet connection to watch my first 1080P internet video

<comment><USER3> I moved in 1998 (ironically) to an isolated island my parents were from and lived there till 2008 and moved back here for college. It was like walking into and out of a time-capsule, I missed the emergence of the internet into what it is today.

I still learned to hack and everything else in Palau regardless, it was just like playing with a handicap, it's still possible to learn and all, it's just harder.

EDIT: to clarify, I didn't have it that bad, there was <20 kbps internet with a monthly total hour cap, but it was expensive and not very reliable and slow.

<comment><USER4> Palau looks - from pictures and travel brochures - to be incredible. Why did you leave?

<comment><USER5> Not having Internet access, probably.

</comment></comment></comment></comment><comment><USER6> Another great reminder that top talent could be born anywhere, and America's edge is that people want to move here to work for American companies.

<comment><USER7> "I am, somehow, less interested in the weight and convolutions of Einstein's brain than in the near certainty that people of equal talent have lived and died in cotton fields and sweatshops." - Stephen Jay Gould

</comment></comment><comment><USER8> What a great story! Cameroon is highly dysfunctional; the government is one of the most corrupt in the world. The fact that this boy can prevail regardless is impressive in a way those of us in more functional societies have trouble appreciating.

</comment><comment><USER9> I will show this article to my sons this weekend and redouble my time with them teaching them to program. As with many things in life (healthcare, food, peace, schools), we also need to appreciate having high-speed Internet access and two parents with programming experience and the time and interest to mentor our children.

</comment><comment><USER10> I also found the part about cutting off mobile for the English-speaking part of Cameroon to be scary.

Esp when Africa relies on mobile for financial transactions and banking and now these people are stuck.

[http://www.bbc.com/news/world-africa-38895541](http://www.bbc.com/news/world- africa-38895541)

<comment><USER11> > Esp when Africa relies on mobile for financial transactions and banking and > now these people are stuck.

"Africa" has no such mobile money reliance - you are probably thinking of Kenya. Africa is 54 countries and 1 billion people, your generalization is overbroad.

</comment></comment><comment><USER12> This is the firs time I've heard about this competition for high school age developers.

Glad it finally got some traction here on HN; I apparently need to find a more education-specific technology news site!

</comment><comment><USER13> Good read to end the week

<comment><USER14> Kind of ruined by an unusual number of toxic comments. But what an inspiring kid.

</comment></comment><comment><USER15> And then just a day after the deadline for final submissions, the internet went dead.

</comment><comment><USER16> I fully expect Ajit Pai to use this as proof we don't need any improvements to infrastructure in the US.</comment>


Clever "down for maintenance" page - <AUTHOR> http://down.grooveshark.com/

<comment><USER3> I'm going to go out on a limb here and suggest that not everyone would find a "that's what she said" joke all that clever, or even all that appropriate for a business to subtly present on its site.

And I think this speaks to one of the points I tried to make here (<http://langer.tumblr.com/post/538680961>), which is that ideas like this can come off as witty or clever in such a male-dominated industry because most of us are tone-deaf to the many ways in which another person might find something like this offensive.

<comment><USER4> My hypothesis is that in order to build a cult following, you sort of have to alienate others. Maybe it's crude, but it's part of the equation. The alternative is to take the "corporate" route and build a boring, conservative 404 that could not possibly offend anyone, but would not possibly entertain anyone either.

<comment><USER5> Instinctively, I disagree with you. But you might be right. I may even agree with you, intellectually.

What evidence do you have to support your hypothesis?

Alienation is a very powerful emotional force, used by all sorts of parties to all sorts of ends. Are there 'positive' forms of alienation?

Is there not a middle path that can be taken that doesn't alienate, but also doesn't bore?

<comment><USER4> If a comedian worried about offending people, s/he wouldn't be funny. If Apple worried about alienating large swaths of the marketplace, it wouldn't have a rabid following.

If there weren't a "positive" effect of alienation, people wouldn't consciously cause it. Maybe it's a side-effect of good marketing. Or maybe it props up the sort of us vs. them mentality associated with cult followings. Or maybe I'm getting too philosophical, and everything I'm saying is bullshit.

<comment><USER5> Hah - I didn't intend to end 3/4 of my post with question marks. Or did I? ..ahem.

My comment was really a rhetorical question about the moral (not necessarily commercial - I'm not arguing that) appropriateness of taking (as you described) an alienating path.

I've read quite a few descriptions of marketing as being successful by causing unknown wants and needs. None of those descriptions really talk about 'us and them' as a concept.

[edit-minor typo]

</comment></comment></comment></comment></comment><comment><USER6> They just don't care and love to have fun, and I love them for it.

My roommate, out of undying love for them, sent their team a case of Brooklyn lager just because. They responded with a full video of someone dressed as a shark as a thank you, and he just got an awesome Grooveshark t-shirt in the mail yesterday. This is how you build cult followers.

[http://help.grooveshark.com/a-special-grooveshark-thanks- to-...](http://help.grooveshark.com/a-special-grooveshark-thanks-to-mike/)

<comment><USER7> That's awesome. Just seeing that got me interested in what their product. Definitely impressed. I might just pay for it.

<comment><USER6> It's exactly why I tell everyone around me about GrooveShark if they mention Pandora or another music service. As soon as they get a BB Storm app I may not need my iPod again.

</comment></comment></comment><comment><USER8> Too verbose for my taste.

Here's a good sample of effective maintenance pages: [http://www.smashingmagazine.com/2009/06/12/effective- mainten...](http://www.smashingmagazine.com/2009/06/12/effective-maintenance- pages-examples-and-best-practices/)

<comment><USER9> This page is in that list :) Under heading 4 as the shining example of page that "the same look and feel as your regular site."

<comment><USER8> Yup. Link was to highlight that there are many other examples of more effective maintenance pages than the one from OP.

</comment></comment></comment><comment><USER10> I like how the colour scheme is not the signature grooveshark yellow - <USER2> attempt to limit brand tarnish?

</comment><comment><USER11> Too wordy; I like the idea of status updates (in this case powered by Twitter) on the page though. Neat.

</comment><comment><USER12> Cute story, but I can't see which bit is clever? Perhaps it's an inside joke I just don't get :(

<comment><USER13> Highlight the header, you'll see "That's what she said" after "Going down for a bit". As in, she's going down (on you) for a bit.

<comment><USER14> thanks for the explanation of what thats what she said, meant.

<comment><USER13> Not sure if you're being sarcastic or not, but because there's many non- American/native English speakers, the pun might not be as obvious.

</comment></comment></comment></comment><comment><USER15> The perfect storm, I read the message while listening to 'waiting for your conference to start' elevator music.

</comment><comment><USER16> I like the nearly-hidden "That's what she said." Perhaps not the most appropriate, but still funny.

</comment><comment><USER17> It's not clever - it's puerile, and has no place in a professional organisation. It's equivalent to giggling inanely when someone says "homo sapiens."</comment>