Sunday, May 22, 2022

node.js trigger gc

 javascript - How to request the Garbage Collector in node.js to run? - Stack Overflow

If you launch the node process with the --expose-gc flag, you can then call global.gc() to force node to run garbage collection.

try {
  if (global.gc) {global.gc();}
} catch (e) {
  console.log("`node --expose-gc index.js`");
  process.exit();
}



GitPlanet - Discover interesting open source projects (Chess)

GitPlanet - Discover interesting open source projects

"directory" All CategoriesGames → chess

Top 69 chess open source projects - GitPlanet

vs.

"search"

Search open source project names contain chess - GitPlanet


sfleischman105/Pleco: A Rust-based re-write of the Stockfish Chess Engine

Pleco is a chess Engine & Library derived from Stockfish, written entirely in Rust. (MIT license)


ChizhovVadim/CounterGo: UCI chess engine (golang)

Thursday, May 19, 2022

Timescale: Time-Series DB based on Postgres: $unicorn



Why You Need A Time-Series Database – The Data Exchange

co-founders of Timescale,

with "protective" open source license that prevents cloud hosting

Timescale raised a massive funding round and achieved unicorn status

"PostgreSQL is the best foundation for software applications; and SQL is, and will continue to be, the universal language for data analysis."

timescale/timescaledb: An open-source time-series SQL database optimized for fast ingest and complex queries. Packaged as a PostgreSQL extension. @GitHub



Wednesday, May 18, 2022

ANTLR: parser generator tool (!)

 ANTLR.org

ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files. It's widely used to build languages, tools, and frameworks. From a grammar, ANTLR generates a parser that can build and walk parse trees.

antlr4/index.md at 4.9.3 · antlr/antlr4

antlr4/getting-started.md at master · antlr/antlr4 @GitHub


ANTLR - Wikipedia

Terence Parr - Wikipedia


tunnelvisionlabs/antlr4ts: Optimized TypeScript target for ANTLR 4

Dig ANTLR4 with Typescript. Parsers are fun. Writing one is not… | by Houfu Ang | Medium


docker

antlr4/docker at master · antlr/antlr4


Building a simple expression language - Strumenta


ANTLR v4 with Terence Parr - YouTube

Alena Khineika: Writing compilers in JavaScript using ANTLR - YouTube

Create a Text Parser in C# with ANTLR - YouTube

books:

The Definitive ANTLR 4 Reference by Terence Parr (book @ PragProg)

start here:

antlr4/getting-started.md at master · antlr/antlr4 @GitHub

antlr/grammars-v4: Grammars written for ANTLR v4; expectation that the grammars are free of actions.



//lexmachina.com

Tuesday, May 17, 2022

ML photo cleanup, amazing!

 saic-mdal/lama: 🦙 LaMa Image Inpainting, Resolution-robust Large Mask Inpainting with Fourier Convolutions, WACV 2022

LaMa: Resolution-robust Large Mask Inpainting with Fourier Convolutions

Official implementation by Samsung Research


Monday, May 16, 2022

Zipline drone delivery

Zipline - Instant Logistics

podcast
Launching Drone Delivery - Pushkin
Zipline’s drones already make hundreds of deliveries a day in Ghana and Rwanda. But to expand to the U.S. he has to solve a fundamental problem. Americans’ love of freedom and the open skies makes it hard to build a drone business here.





Sunday, May 15, 2022

VS Code: drag/drop URL to markdown

 Releases · microsoft/vscode April 2022 updates





25 years with cURL

very interesting podcast interview with creator of cURL

it could be that cURL is deployed to more devices than SQLite!

it is used in many other tools and devices, including PHP

it is using other tools and libs, like SSL, and even Rust

Episode 505: Daniel Stenberg on 25 years with cURL : Software Engineering Radio

... about the history of cURL, libcurl, whether C was the right choice, portability, key events in those 25 years, implementing protocols, why HTTP is not so simple, rust libs, the Polhem Prize, security issues, feature requests, random support requests, code on Mars, Apple OS adoption, cars stuck in production lines, Android OS, 8-week release cycles, release cycle joy, breakdown of bug types, 1000 committers, 250 cli options, user bases, determination, json, libSSH2, c-ares, HTTPbis, HTTP/2, QUIC, Mozilla, OpenSSL, WolfSSL, DNS, FTP, the cURL book, testing, CI/CD, favorite command line options that you might not know about, and making sure that you don’t give up on that idea or project you are working on.



"If your Windows 10 build is 17063, or later, cUrl is included by default. All you need to do is run Command Prompt with administrative rights and you can use cUrl . The Curl.exe is located at C:\Windows\System32. If you want to be able to use cUrl from anywhere, consider adding it to Path Environment Variables."


Friday, May 13, 2022

Web3 NFT tool: Bitski

Bitski

based on Ethereum, using Rust and HSM (hardware based security modules)


podcast:

Bitski: Web3 Infrastructure with Patrick Tescher - Software Engineering Daily

Thursday, May 12, 2022

SQL parser in GoLang


Let's build a SQL parser in Go! – Mariano Gappa's Blog

introduction to constructing an LL(1) parser in Go, in this case for parsing SQL queries. It assumes minimal programming competence (functions, structs, ifs and for-loops).

Here’s the complete parser repository if you want to skip to results:

github.com/marianogappa/sqlparser

Wednesday, May 11, 2022

cheesse Chess: TinyGo => WebAssembly

 Running Golang on the browser with WebAssembly and TinyGo – Mariano Gappa's Blog

Golang chess API project cheesse (Chess) as a WebAssembly binary, compiled using TinyGo, so JavaScript could use it without needing a server.

Monday, May 09, 2022

Avalonia UI: portable DotNet UI

works similar to Flutter, not like Xamarin

Avalonia UI

Episode 95 - Avalonia UI with Dan Walmsley · The .NET Core Podcast

fsprojects/Avalonia.FuncUI: Develop cross-plattform MVU GUI Applications using F# and Avalonia!

YAML vs JSON vs XML in Go: speed, size?

 YAML vs JSON vs XML in Go, which is best? | Geek Culture

JSON is clear winner in all categories

Interesting: YAML takes more space for "whitespace", and for some reason much more time to decode and decode. Possibly JSON extreme simplicity helps speed

Sunday, May 08, 2022

JSON5 Data Interchange Format: "JSON for humans"

JSON is simplified subset of JavaScript data syntax.
Adding a few more JS features to JSON would help usability.

The JSON5 Data Interchange Format (json5.org)

"The JSON5 Data Interchange Format (JSON5) is a superset of JSON that aims to alleviate some of the limitations of JSON by expanding its syntax to include some productions from ECMAScript 5.1.

Similar to JSON, JSON5 can represent four primitive types (strings, numbers, Booleans, and null) and two structured types (objects and arrays)."



example:
{
  // comments
  unquoted: 'and you can quote me on that',
  singleQuotes: 'I can use "double quotes" here',
  lineBreaks: "Look, Mom! \
No \\n's!",
  hexadecimal: 0xdecaf,
  leadingDecimalPoint: .8675309, andTrailing: 8675309.,
  positiveSign: +1,
  trailingComma: 'in objects', andIn: ['arrays',],
  "backwardsCompatible": "with JSON",
}

this may be one of most downloaded on NPM? Weekly Downloads: 55,801,906







there are also official "readonly" versions in DotNet (C#) and GoLang (go) JSON5 @github







Currently, this library is about 20x SLOWER than using Jackson.

Rust


ANTLR parser grammar for JSON5



Amazon "Buy with Prime" vs UPS, FedEx

 Amazon will extend Prime shipping benefits, and its own reach, to independent e-commerce sites - GeekWire

"Amazon’s Buy with Prime program will extend Prime checkout and shipping benefits to independent e-commerce sites. (Amazon Photo)

A new Amazon program will let Prime members buy items on non-Amazon e-commerce sites just as they would on Amazon.com, including streamlined checkout and free delivery of items as soon as the next day.

It’s part of a broader effort by Amazon to extend its shipping operations beyond its own digital walls, competing more directly with UPS and FedEx — a move that analysts have been anticipating since last year."





Amazon: $1.2T
UPS: $160B
FedEx: $55B



Friday, May 06, 2022

AWS CloudFront Functions

example usage: with static web sites stored in S3, then URL ends with "/" to appends "index.html"

An Introduction To AWS CloudFront Functions - Honeybadger Developer Blog

"CloudFront Functions are an incarnation of FaaS (Function as a Service) and allow you to deploy JavaScript functions to AWS' network of edge locations, to be executed as close as possible to end users.

This new feature allows you to customize or personalize content for your application users closer to where they’re located, thus minimizing network latency. For example, you can transform HTTP headers or API responses to personalize your application for each visitor, implement authentication or encryption logic (such as JWT authentication) to allow or deny requests, or set up URL rewrites and redirects right on the edge."


function handler(event) { var request = event.request; var uri = request.uri; // Check whether the URI is missing a file name. if (uri.endsWith('/')) { request.uri += 'index.html'; } // Check whether the URI is missing a file extension. else if (!uri.includes('.')) { request.uri += '/index.html'; } return request; }

Thursday, May 05, 2022

How to create AWS CloudFront distribution

from aws console (web)

Creating, updating, and deleting distributions - Amazon CloudFront


frim CLI

create-distribution — AWS CLI 2.6.2 Command Reference

Security/110-Serving-Web-Content-Securely-from-S3-with-CloudFront at main · AWSCookbook/Security


from CloudFormation

Amazon CloudFront template snippets - AWS CloudFormation


from Terraform

aws_cloudfront_distribution | Resources | hashicorp/aws | Terraform Registry


from JS SDK

CreateDistributionCommand | CloudFront Client - AWS SDK for JavaScript v3

CloudFront Client - AWS SDK for JavaScript v3

AWS SDK for JavaScript v3 docs

aws/aws-sdk-js-v3: Modularized AWS SDK for JavaScript. @GitHub

modular architecture with a separate package for each service. It also includes many frequently requested features, such as a first-class TypeScript support and a new middleware stack

First-class TypeScript support in modular AWS SDK for JavaScript | AWS Developer Tools Blog


from Go SDK

How to create a CloudFront distribution with AWS SDK for Go – Jibril Touzi – Principal Site Reliability Engineer & Cloud Solutions Architect


GoLang AST tools

Rewriting Go source code with AST tooling - Eli Bendersky's website

ast package - go/ast - pkg.go.dev


Abstract Syntax Trees (ASTs) in Go | Eleni Fragkiadaki

Generate Go source code - Stack Overflow

To convert an AST to the source form one can use the go/printer package.

Golang AST Package - GoLang Docs

Basic AST Manipulation in Go - zupzup

Tuesday, May 03, 2022

WASI with Rust

 webassembly system interface (wasi) changes everything.. getting started tutorial using rust & wasm - YouTube

"in this video we look at how using WASI (web assembly system interface), we can create more powerful webassembly applications that can interact with i/o such as the console and filesystems using WASI. 

we create some rust cli apps and then build their equivalent webassembly cli apps in rust. we explore how to write to the console. write to files and access command line arguments. finally we look at how we can use runtimes to excute our cli apps or create native executables, as well as thinking about webassembly/wasi use cases. "

chrishayuk/chuk-wasi-rust @GitHub


WASI.dev


WASI is a modular system interface for WebAssembly. As described in the initial announcement, it’s focused on security and portability.

For a quick intro to WASI, including getting started using it, see the intro document.


Haskell functional programming language

Logo of Haskell

Haskell Language

Haskell (programming language) - Wikipedia

Haskell (/ˈhæskəl/[27]) is a general-purpose, statically-typed, purely functional programming language with type inference and lazy evaluation.[28][29] Designed for teaching, research and industrial application, Haskell has pioneered a number of programming language features such as type classes, which enable type-safe operator overloading. Haskell's main implementation is the Glasgow Haskell Compiler (GHC). It is named after logician Haskell Curry.[1

Haskell @GitHub

free online book: Learn You a Haskell for Great Good! 

Chapters - Learn You a Haskell for Great Good!

Real World Haskell

Downloads

Haskell - Official Image | Docker Hub


Haskell Tutorial - YouTube by Derek Banas

Functional Programming & Haskell - Computerphile - YouTube



Haskell - Environment Set Up


Monday, May 02, 2022

Microsoft Teams: exponential growth

 Microsoft Teams Revenue and Usage Statistics (2022) - Business of Apps

Microsoft Teams revenue

YearRevenue
2017$0.01 billion
2018$0.2 billion
2019$0.8 billion
2020$6.8 billion

Microsoft Teams users

YearUsers
20172 million
20188 million
201920 million
Q2 202075 million
Q4 2020115 million
Q2 2021145 million

Sunday, May 01, 2022

Book: text => audio, video: "Terraform in Action"

An interesting "experiment" of publishing same book in 3 different "formats": ebook + audio => video

Both "video" and "audio" are interesting, while really lacking good usability

While audio works well for "prose", a technology book does need "illustrations" and "code", so that is almost non-strarter

The video is a reasonable "text to speech" solution, but it feels "constrained" by not being able to see more than one snipped at a time. 

A "notebook" or even plain e-book augmented with with auto text-to-speech may be much more usable solution.

One more side note: the "professional reader" of book's text does not work very well here.
A video class / lecture has an engaged author explaining concepts, and is usually effective.
A "human reader" is two steps detached from the original context, less effective for learning.

 Terraform in Action e-book @ O'Reilly Learning

Terraform in Action video edition

Terraform in Action audiobook

Terraform in Action @ Manning


GoLang => JavaScript

gopherjs/gopherjs: A compiler from Go to JavaScript for running Go code in a browser

GopherJS Playground


matthewmueller/joy: A delightful Go to Javascript compiler (ON HOLD)

Introducing Joy