Stroustrup on Concepts, Scalability, Type Safety etc

Interesting interview where Bjarne elaborates his opinion on modern languages and development of C++. Interesting to know that he actually hates generic programming and its implementation in form of templates. He loves Concepts and hopes to push them into 2023 standard.

https://thenewstack.io/c-creator-bjarne-stroustrup-weighs-in-on-distributed-systems-type-safety-and-rust/

What’s new in the world of WebAssemblies. Rust is better than Python?

WebAssembly technology was not supposed to be a mainstream thing. Idea of making high performance low level environment inside browser virual machine was somewhat quirky but promised a lot in the end. We could recompile any code from any language into more suitable low level instructions instead of using one more layer of Javascript. Good in theory. Practice is a bit rough. I personally don’t know any of popular framework that would use WebAssembly underneath as a runtime. There are many experimental projects and interesting ideas around it. Will WebAssembly live up to its promise and potential?
Here’s the talk from Steve Klubnik on this:

Things are developing pretty fast these days. Rust became a mainstream language. Originally developed as a replacement for C++, more on system side, than to be an application oriented language, Rust evolved into a mature ecosystem. Package managers and frameworks have been built and devs started looking at it as a replacement for more generic script languages. You can argue that statically typed language is not a replacement for, say, Python, and you will be right. But Rust still can be a good alternative to Python. Here’s a talk from Owen Synge why you should consider Rust. I found his arguments pretty compelling. One of them is a garbage collector implementation differences. Rust is using reference counting mechanism which does not require a global lock for the collector. In multi-process and threaded environment it’s a big advantage. Rust is indeed more performant.

https://www.youtube.com/watch?v=IYLf8lUqR40

Intro to WebAssembly

Good article about current state of WebAssembly with examples and links to resources.
I like the idea of common low level language/runtime for web. Even here in my blog I did criticize state of Javascript, fragmentation and sloppy attempt to make native code run along/inside the browser with NaCL.
WebAssembly seemed and still seems to be the right way to go. There are exactly two things that still bother me though:
1. Speed of adoption and standard development, which is probably a false negative, because everything in web standards world is going slow.
2. Syntax… why braces again!? I bet committee was infiltrated by Lisp lovers. 😛

Here’s the article.

github:
https://github.com/WebAssembly/wabt

Go Garbage Collector

Good read on how GC is implemented and optimized in Go run-time. It goes through typical issues with GC at scale and real-time systems.
Sorry for posting another bookmark to the stream. I hope some of these posts are actually useful to others. 😛
https://blog.golang.org/ismmkeynote

Source code in Microsoft Word

Somebody finally did that! Somebody created Office add-on that allows to import source code with highlights and right format.
Check it out!

Another useful tool for source code copy/paste if you’re using Sublime Text:
https://github.com/n1k0/SublimeHighlight

There are even more ideas on how to insert source code into Word, Office, Excel or whatever here:
https://stackoverflow.com/questions/387453/how-do-you-display-code-snippets-in-ms-word-preserving-format-and-syntax-highlig

Running Windows 10 from external drive on Mac

Some time ago I was able to create bootable Windows 10 installation on external SSD drive. It worked perfectly and I was able to play all Windows only games. However, it all went south when I upgraded my Macbook Pro to new 2017 model… Well. Old USB drivers stopped working, so after boot I could not use either keyboard nor mouse. Apparently there are many step-by-step instructions on how to install Window 8 and 10 on external drive, but many of them are outdated or do not cover my specific problem. Luckily there’s a discussion thread on Apple’s own support forum on how to troubleshoot and fix similar issues.
In my case I had to download new set of drivers from Bootcamp Assistant and install them. Luckily I found external USB keyboard that worked with Macbook!
Here’s the thread you may find useful.
Another good tutorial on how to fix drivers issue using a VM (if you can boot your bootcamp in VM):
https://support.twocanoes.com/hc/en-us/articles/203759489-Solution-for-non-functional-keyboard-and-mouse-after-Windows-7-Boot-Camp-restore

What’s new in Swift 4

There’s very good article on most important changes in Swift 4 by Ray Wanderlich here:
https://www.raywenderlich.com/163857/whats-new-swift-4
Most important changes are in containers. They promoted strings to containers finally! A lot of cleanups and improvements.
I found Generic Subscripts a good addition. I’ve tried to use generics in my custom class and ran into the fact that I can’t create a subscript. Now I can.
Check it out!

Fish shell intro

Came across great video tutorial/introduction to Fish shell. I’ve tried to switch to Fish couple times in my life and every time I got stuck somewhere. Third time is a charm, I guess? 🙂

Anyway, here’s a nice video you must watch before trying to abandon your bash (or zsh or whatever).

Lifehack: If you can’t compile old XCode project “There is no SDK with the name or path”

If your old project fails to compile with XCode with error like
error: There is no SDK with the name or path ‘/path/to/my/project/macosx10.6’

even if you changed target in the XCode Build Settings, then you stumbled upon silly bug in the XCode. It’s just unable to change SDKROOT in your pbxproject file. Edit it manually and remove all SDKROOT lines.

How to redirect std C++ streams to Visual Studio debug output

Discovered this trick for the first time. You can use AllocConsole() to redirect ANY std stream to debug console.

In most cases people use either TRACE() statement (but you have include MFC or ATL for that) or Win API OutputDebugString().

With AllocConsole() your code may look like this:

   freopen("CONOUT$", "w", stdout);

That’s it!

Learning something new every day. 😀

Proudly powered by WordPress
Theme: Esquire by Matthew Buchanan.