Saturday, April 06

Geek

Daily News Stuff 6 April 2019

Crystal Ball Edition

Tech News

  • I bought and read Programming Crystal last night and sat down this afternoon and wrote the little app I needed.

    A bit of fiddling and refactoring and reading the docs for the Crystal standard library (which could do with some fleshing out) and it works.  The code is clean, it compiles quickly, the binary is portable, and it's only 6 megabytes.

    Okay, that last part isn't so great; as soon as I included the HTTP client library it yanked in 3.3MB of extra code.  But that's what static linking does for you.

    Don't concatenate large strings in a loop, though.  Python handles that very well because it reserves space at the end of each string and can reuse the memory.  Most languages don't do that trick and allocate memory and copy the entire string every time, so appending one byte to a one megabyte string is contraindicated.

    This is something you have to watch out for just going from CPython to PyPy with the same code, so it's something I check with every language.

    Oh yes.  As to the IDE question, while there is no convenient CrystalMine from Jetbrains, and the plugin that is available is meh, if you install VSCode and Windows Services for Linux and Ubuntu 18.04 under WSL and Crystal under Ubuntu 18.04 under WSL and the Crystal Language extension for VSCode (the one by Faustino Aguilar) and the Crystal Installer for Windows which does not install Crystal on Windows because Crystal doesn't run on Windows bu instead creates a .bat file pointing to the Crystal on Ubuntu on WSL and puts the .bat file in your path...  It mostly works.

    I also gave the Amber web framework a try.  After some initial swearing when I was editing the wrong copy of my source file, it basically worked.  I've looked at innumerable web frameworks over the last decade and this one is easy to pick up.  It compiles down to a portable binary (if you want).  But it does use the Code of Cancer.  Ugh.

    That crap aside, it's a lot faster than CherryPy, which I have been using for years, even CherryPy running under PyPy.  I'd previously tested Swift with the Vapor framework and it wasn't much faster than CherryPy under PyPy, certainly not enough to justify a switch of programming languages.

    Responding to 50,000 simple queries takes around 70 CPU seconds with CherryPy on CPython, 20 seconds on PyPy, and 1.5 seconds with Amber on Crystal 0.27.  That's a big difference.  (This is all on a small VPS with a single server process and default configuration.)

    This bears some thinking about.  

  • PostgreSQL is an enormously powerful SQL database built by perfectionists and designed by idiots that tells you to go fuck yourself at every possible occasion.

  • Optane DIMMs cost about half as much as RAM.  (AnandTech)

    A 128GB Optane DIMM costs around $900, the price of a 64GB DDR4 module, and a 256GB Optane DIMM at $2850 is about the price of a 128GB DDR4 module.  (Higher density modules are proportionally more expensive.)

    On the other hand, you can only use Optane DIMMs with very expensive CPUs, and they are significantly slower than DRAM (though still lightning fast compared to SSDs.)  So the market for these at the moment seems small.

  • "Ironically" too many video streaming services is leading to an increase in piracy.  (TechDirt)

    That's not irony, you idiots, that's arithmetic.

    All told, there are more than 300 over-the-top video options in the U.S.

    Zombies.  These businesses are funded and run entirely by zombies.  Only explanation.  (Ars Technica)

  • Lessons learned from porting 50,000 lines of code from Java to Go.

    From the publisher of such titles as A Walking Tour of the Sewers of Major European Cities and Leaving Ethiopia for Somalia.

  • A one-day bug bounty program run by Dropbox found 264 vulnerabilities.  (ZDNet)

    Uh, what?

  • A misconfigured Qt5 app and a malicious link can ruin your whole day.  (Bleeping Computer)

  • A sneaky hacker slipping a backdoor into a popular library can ruin your whole day.  (ZDNet)

    Fortunately this one was caught and removed the same day it appeared. 

Social Media News


5K 360° Video of the Day



For those of you with iMacs and gigabit internet access.



Disclaimer: No news is no news.

Posted by: Pixy Misa at 08:08 PM | Comments (4) | Add Comment | Trackbacks (Suck)
Post contains 741 words, total size 7 kb.

1 Well, it looks like Amazon just ">banned Programming Crystal.
(It could just be a glitch, or a bad link, but for some strange reason, nowadays I tend to default to suspecting mischief.)

Posted by: The Brickmuppet at Sunday, April 07 2019 02:40 AM (xOgT9)

2 Yeah, I don't know what happened to that URL,  Fixed now.

Posted by: Pixy Misa at Sunday, April 07 2019 03:04 AM (PiXy!)

3 360 video is kind of neat, but a bit hampered by YouTube considering the clicks as transport control too (Pause and play).
Also, I have, for decades, been using a fairly flat FileMaker database to track my comic book orders. But considering that's running only on a Mac from the 1990's, I was considering trying to migrate to another database. I was trying to learn how to use the SQL built into OpenOffice, but damned it was hard. Seems like it's mostly designed for accessing and querying existing databases, and not for creating new ones.

I need a good guide book.

Posted by: Mauser at Sunday, April 07 2019 04:27 AM (Ix1l6)

4 From the Java->Go article: "For simplicity I went with a single package."
michael-scott-god-no.gif

Posted by: Jay at Sunday, April 07 2019 11:52 PM (vuQH5)

Hide Comments | Add Comment




Apple pies are delicious. But never mind apple pies. What colour is a green orange?




56kb generated in CPU 0.0201, elapsed 0.4984 seconds.
58 queries taking 0.4897 seconds, 344 records returned.
Powered by Minx 1.1.6c-pink.