diff --git a/.eleventy.js b/.eleventy.js deleted file mode 100644 index 81fde5f..0000000 --- a/.eleventy.js +++ /dev/null @@ -1,53 +0,0 @@ -const syntaxHighlight = require("@11ty/eleventy-plugin-syntaxhighlight"); - -module.exports = function(eleventyConfig) { - eleventyConfig.addPassthroughCopy("public"); - eleventyConfig.addPlugin(syntaxHighlight); - - const markdownIt = require("markdown-it"); - - const md = markdownIt({ - html: true, - linkify: true, - typographer: true - }); - - eleventyConfig.setLibrary("md", md); - - md.use(require("markdown-it-toc-done-right")) - md.use(require("markdown-it-attrs")) - md.use(require("markdown-it-imsize")) - md.use(require("markdown-it-sub")) - md.use(require("markdown-it-sup")) - - md.use(require("markdown-it-anchor"), { - permalink: true, - // permalinkSymbol: "#", - permalinkBefore: false - }) - - md.use(require("markdown-it-implicit-figures"), { - figcaption: true - }) - - const markdownItContainer = require("markdown-it-container"); - - md.use(markdownItContainer, 'off') - md.use(markdownItContainer, 'hero') - md.use(markdownItContainer, - 'spoiler', { - validate: function(params) { - return params.trim().match(/^spoiler\s+(.*)$/); - }, - - render: function (tokens, idx) { - var m = tokens[idx].info.trim().match(/^spoiler\s+(.*)$/); - - if (tokens[idx].nesting === 1) { - return '
' + md.utils.escapeHtml(m[1]) + '
\n'; - } else { - return '
\n'; - } - } - }) -}; diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 022daa3..0000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: Npm build - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - runs-on: ubuntu-latest - - strategy: - matrix: - node-version: [18.x] - - steps: - - uses: actions/checkout@v3 - - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v3 - with: - node-version: ${{ matrix.node-version }} - - - name: Build - run: | - npm install - npm run build diff --git a/.github/workflows/static.yml b/.github/workflows/static.yml deleted file mode 100644 index 4a64129..0000000 --- a/.github/workflows/static.yml +++ /dev/null @@ -1,43 +0,0 @@ -# Simple workflow for deploying static content to GitHub Pages -name: Deploy static content to Pages - -on: - # Runs on pushes targeting the default branch - push: - branches: ["master"] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -permissions: - contents: read - pages: write - id-token: write - -# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. -# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. -concurrency: - group: "pages" - cancel-in-progress: false - -jobs: - # Single deploy job since we're just deploying - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Setup Pages - uses: actions/configure-pages@v4 - - name: Upload artifact - uses: actions/upload-pages-artifact@v3 - with: - # Upload entire repository - path: "." - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 1b089e2..0000000 --- a/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules -_site -package-lock.json diff --git a/_includes/footer.pug b/_includes/footer.pug deleted file mode 100644 index 67fedb8..0000000 --- a/_includes/footer.pug +++ /dev/null @@ -1,2 +0,0 @@ -footer - p Vlad Faust © 2016-2023 diff --git a/_includes/head.pug b/_includes/head.pug deleted file mode 100644 index c234857..0000000 --- a/_includes/head.pug +++ /dev/null @@ -1,34 +0,0 @@ -//- Meta -meta(charset='UTF-8') -meta(name='viewport', content='width=device-width, initial-scale=1.0') - - -title= title ? (titleNoAppend ? title : (title + " - Vlad Faust Blog")) : "Vlad Faust Blog" -meta(name='description', content=description || excerpt) -meta(name='robots' content="index,follow") -meta(name='generator' content='Eleventy') - - -meta(name='twitter:card', content='summary') -meta(name='twitter:site', content='@vladfaust') -meta(name='twitter:creator', content='@vladfaust') -meta(name='twitter:url', content='https://vladfaust.com' + page.url) -meta(name='twitter:title', content=title) -meta(name='twitter:description', content=description || excerpt) -meta(name='twitter:image', content=(twitterCover || cover) ? ('https://vladfaust.com' + (twitterCover || cover)) : '') - - -meta(property='og:url', content='https://vladfaust.com' + page.url) -meta(property='og:type', content=ogType || 'website') -meta(property='og:title', content=title) -meta(property='og:image', content=(ogCover || cover) ? ('https://vladfaust.com' + (ogCover || cover)) : '') -meta(property='og:description', content=description || excerpt) -meta(property='og:site_name', content=title) -meta(property='og:locale', content='en_GB') -meta(property='article:author', content='https://vladfaust.com') - -//- Icons -link(rel='icon', href='/public/icon/cap.svg', sizes='any', type='image/svg+xml') - -//- Fonts -link(href="https://fonts.googleapis.com/css2?family=Vollkorn:wght@400;700&display=swap", rel="stylesheet") diff --git a/_includes/header.pug b/_includes/header.pug deleted file mode 100644 index f7b2731..0000000 --- a/_includes/header.pug +++ /dev/null @@ -1,22 +0,0 @@ -header - a.me(href="/") - img(src='/public/img/me.jpg') - div.text - p - | Hello, my name is  - a(href='/') Vlad Faust - | . - p.tablet-hide - | I am a jack of anything IT, master of some; see my  - a(href='/cv') CV - | . - p.tablet-hide - | You can contact me via  - a(href='https://x.com/vladfaust') 𝕏 - | ,  - a(href='https://github.com/vladfaust') GitHub - | or  - a(href='https://t.me/vladfaust') Telegram - | , or e-mail me directly at  - i hey at vladfaust.com - | . diff --git a/_includes/note.pug b/_includes/note.pug deleted file mode 100644 index b6416e7..0000000 --- a/_includes/note.pug +++ /dev/null @@ -1,22 +0,0 @@ -doctype html -html(lang='en') - head - include /head.pug - - //- Styles - link(rel='stylesheet', href='/public/styles/post.css') - link(rel='stylesheet', href='https://unpkg.com/prismjs@1.20.0/themes/prism.css') - body - include /header.pug - - main.line-numbers - h1= title - p.meta - time.pubtime(datetime=page.date.toISOString())= page.date.toDateString() - if location - | ,  - = location - hr - article(class=(asciiDoctor ? "asciidoctor" : ""))!= content - - include /footer.pug diff --git a/_includes/post.pug b/_includes/post.pug deleted file mode 100644 index 27f2056..0000000 --- a/_includes/post.pug +++ /dev/null @@ -1,22 +0,0 @@ -doctype html -html(lang='en') - head - include /head.pug - - //- Styles - link(rel='stylesheet', href='/public/styles/post.css') - link(rel='stylesheet', href='https://unpkg.com/prismjs@1.20.0/themes/prism.css') - body - include /header.pug - - main.line-numbers - h1= title - p.meta - time.pubtime(datetime=page.date.toISOString())= page.date.toDateString() - if location - | ,  - = location - hr - article!= content - - include /footer.pug diff --git a/_includes/posts.pug b/_includes/posts.pug deleted file mode 100644 index 6d62753..0000000 --- a/_includes/posts.pug +++ /dev/null @@ -1,5 +0,0 @@ -ul.posts - each post in [...collections.post].reverse().filter((post) => !post.data.hidden && post.date <= Date.now()) - li - span.date= post.date.toDateString() - a.title(href=post.url)= post.data.title diff --git a/_includes/projects.pug b/_includes/projects.pug deleted file mode 100644 index ca4562e..0000000 --- a/_includes/projects.pug +++ /dev/null @@ -1,433 +0,0 @@ -h3 Singularity tech (2022-present) -small.annotation - | Behold, the Deus ex Machina blooms, like a lotus from the murky depths. - -ul.projects - li.project-card - a.title(href="https://github.com/derouter/derouter") DeRouter - p.desc - | Decentralized, uncensored open-source API marketplace. - .stack - span Open source - span Rust - span P2P - - li.project-card - a.title(href="https://github.com/vladfaust/aistories") AIStories - p.desc - | The original source-available AI character simulation platform. - .stack - span Open source - span Commercial - span AI - span Crypto - span NFTs - span TypeScript - span VueJS - span NodeJS - span trpc - span zod - span Solidity - span ethers - - li.project-card - a.title(href="https://github.com/vladfaust/kawaiii") Kawaiii - p.desc - | OnlyFans, but for Web3. - .stack - span Open source - span Commercial - span TypeScript - span Ethereum - - li.project-card - a.title(href="https://github.com/offchaincafe/evm") Offchain Café EVM - p.desc - | A self-hosted indexing service for Ethereum blockchain, exposing a GraphQL API. - .stack - span Open source - span Crypto - span EVM - span Solidity - span TypeScript - span GraphQL - li.project-card - a.title(href="https://github.com/nxsf/ipnft") IPNFT - p.desc - | An on-chain, digital proof of authorship for an IPFS CID, tailored to existing NFT standards. - .stack - span Open source - span Crypto - span IPFS - span EVM - span Solidity - li.project-card - a.title(href="https://github.com/fancysofthq/contracts") Fancy Contracts - p.desc - | A collection of EVM smart contracts for the Fancy Software apps ecosystem. - .stack - span Open source - span Crypto - span EVM - span Solidity - -h3 Onyx, the language (2020-2022) -small.annotation - | Onyx is a novel programming language I'was working on. - -ul.projects - li.project-card - a.title(href="https://nxsf.org") NXSF.org - p.desc - | The Onyx Software Foundation website ( - a(href="https://github.com/nxsf/nxsf.github.io") source - | ). - .stack - span Open source - - li.project-card - a.title(href="https://nxsf.org/onyx/") Onyx standard - p.desc - | An attempt to standardize the Onyx language ( - a(href="https://github.com/nxsf/onyx") source - | ). - .stack - span Open source - - li.project-card - a.title(href="https://github.com/fancysofthq/phoenix") Phoenix - p.desc An attempt to implement an Onyx language compiler in C++. - .stack - span Open source - span C++ - - li.project-card - a.title(href="https://github.com/onyxlang/rs") Onyx in Rust - p.desc An attempt to implement an Onyx language compiler in Rust. - .stack - span Open source - span Rust - - li.project-card - a.title(href="https://github.com/onyxlang/ts") Onyx in Typescript - p.desc An attempt to implement an Onyx language compiler in TypeScript + Zig. - .stack - span Open source - span Zig - span TypeScript - -h3 Crystal-related projects (2018-2020) -small.annotation - a(href="https://crystal-lang.org") Crystal - | is a Ruby-inspired programming language, but compiled. - -ul.projects - li.project-card - span.title - a(href="https://onyxframework.com/") Onyx framework - | (2020) - p.desc - | A web framework with  - a(href="https://github.com/onyxframework/http") HTTP - | ,  - a(href="https://github.com/onyxframework/sql") SQL ORM - | and  - a(href="https://github.com/onyxframework/eda") EDA - | modules, fancy website and rich documentation. - .stack - span Open source - span Product design - span Crystal - span SQL - span HTTP - span Event-driven architecture - span VueJS - span SASS - - li.project-card - span.title - a(href="https://github.com/crystaljobs") Crystal Jobs - | (2018) - p.desc - | A now defunct Crystal jobs board ( - a(href="https://crystaljobs-staging.netlify.app/") frontend preview - | ). - .stack - span Open source - span Product design - span Crystal - span VueJS - span SASS - - li.project-card - span.title - a(href="https://github.com/vladfaust/crystalworld") CrystalWorld - | (2019) - p.desc - | A  - a(href="https://github.com/gothinkster/realworld") RealWorld - | implementation in Crystal and Onyx the web framework. - .stack - span Open source - span Crystal - span SQLite - -h4 Crystal shards (2018-2020) -small.annotation - | A  - i shard - | is a Crystal code package. - -ul.projects - li.project-card - a.title(href="https://github.com/vladfaust/time_format.cr") TimeFormat - p.desc Time spans formatting made simple. - .stack - span Open source - span Crystal - - li.project-card - a.title(href="https://github.com/vladfaust/i18n.cr") I18n - p.desc Internationalization shard. - .stack - span Open source - span Crystal - - li.project-card - a.title(href="https://github.com/vladfaust/http-multiserver.cr") HTTP::Multiserver - p.desc Mount multiple web applications. - .stack - span Open source - span Crystal - span HTTP - - li.project-card - a.title(href="https://github.com/vladfaust/tarantool.cr") Tarantool - p.desc - | A  - a(href="https://www.tarantool.io/ru/") Tarantool - | database driver. - .stack - span Open source - span Crystal - span TCP - - li.project-card - a.title(href="https://github.com/vladfaust/cake-bake") Cake-Bake - p.desc Bake Cakefile into native Crystal code. - .stack - span Open source - span Crystal - - li.project-card - a.title(href="https://github.com/vladfaust/callbacks.cr") Callbacks - p.desc Expressive callbacks module. - .stack - span Open source - span Crystal - - li.project-card - a.title(href="https://github.com/vladfaust/validations.cr") Validations - p.desc Validations module. - .stack - span Open source - span Crystal - - li.project-card - a.title(href="https://github.com/vladfaust/mini_redis") MiniRedis - p.desc A light-weight low-level Redis client. - .stack - span Open source - span Crystal - span TCP - - li.project-card - a.title(href="https://github.com/vladfaust/http-params-serializable") HTTP::Params::Serializable - p.desc The HTTP params parsing module. - .stack - span Open source - span Crystal - - li.project-card - a.title(href="https://github.com/vladfaust/migrate.cr") Migrate - p.desc A database migration solution. - .stack - span Open source - span Crystal - span SQL - - li.project-card - a.title(href="https://github.com/vladfaust/stripe.cr") Stripe - p.desc Stripe API wrapper. - .stack - span Open source - span Crystal - span API wrapper - - li.project-card - a.title(href="https://github.com/vladfaust/tele.cr") Tele - p.desc A convenient Telegram Bot framework. - .stack - span Open source - span Crystal - span Telegram bot - - li.project-card - a.title(href="https://github.com/vladfaust/tele-broadcast.cr") Tele::Broadcast - p.desc Broadcasting for Tele. - .stack - span Open source - span Crystal - span Telegram bot - span Redis - -h3 Ruby gems (2015-2017) -ul.projects - li.project-card - a.title(href="https://github.com/vladfaust/jbuilder-json_api") Jbuilder::JsonApi - p.desc Jbuilder meets jsonapi.org specifications. - .stack - span Open source - span Ruby - - li.project-card - a.title(href="https://github.com/vladfaust/asset_pipeline") AssetPipeline - p.desc Add Sprockets based Asset Pipeline to your Ruby applications. - .stack - span Open source - span Ruby on Rails - - li.project-card - a.title(href="https://github.com/vladfaust/bitcoinpay-client") Bitcoinpay - p.desc Bitcoinpay.com API client for Ruby. - .stack - span Open source - span Ruby - span API wrapper - span Crypto - - li.project-card - a.title(href="https://github.com/vladfaust/blockchain-api") Blockchain::Api - p.desc A blockchain.info API wrapper. - .stack - span Open source - span Ruby - span API wrapper - span Crypto - -h3 Other projects -ul.projects - li.project-card(style="background-image:url(/public/img/projects/jumpin_sweeties.png); background-repeat: no-repeat; background-position-x: calc(100% + 5rem); background-size: 15rem;") - span.title - a(href="https://xgm.guru/p/sweeties") Jumpin Sweeties - | (2015) - p.desc A casual mobile game. - .stack - span GameDev - span Java - span LibGDX - - li.project-card - span.title - a(href="https://parrotfarm.herokuapp.com/") Parrot Farm - | (2016) - p.desc - | A showcase project to demonstrate my skills at those times - small , hosted on Heroku. - .stack - span Open source - span Ruby on Rails - span AngularJS - - li.project-card - span.title - a(href="https://nostalgic-hopper-8a1414.netlify.app/") Coinpricebet - | (2018) - p.desc - | A Stellar-based betting on crypto coin prices, also  - a(href="https://loving-mahavira-537556.netlify.app/") this - | version. - .stack - span Product design - span Crypto - span VueJS - - li.project-card - span.title - a(href="https://heuristic-wozniak-28f7b6.netlify.app/") AssetFD - | (2018) - p.desc An unfinished decentralized exchange interface based on Stellar. - .stack - span Crypto - span VueJS - - li.project-card - span.title - a(href="https://github.com/soundmemes") Soundmemes Bot - | (2016-2018) - p.desc A now defunct Telegram bot to post sound memes in chats. - .stack - span Open source - span Product design - span Telegram bot - span Ruby - span Crystal - span PostgreSQL - span Redis - - li.project-card - span.title - a(href="https://telegra.ph/CashbackBot-09-16") Cashback Bot - | (2017) - p.desc A now defunct Telegram bot to earn cashback from purchases. - .stack - span Product design - span Telegram bot - span Ruby - span GraphQL - span API wrapper - span PostgreSQL - span Redis - - li.project-card - span.title - a(href="https://www.dropbox.com/sh/wpqjtnw0avw6278/AAC55zKcrbVzFmL12xIT4rK2a?dl=0") Expense Manager 2 - | (2015) - p.desc A collaborative attempt to improve an existing app. - .stack - span Product design - span Java - span Android - - li.project-card - span.title - a(href="https://www.dropbox.com/sh/0heutamg923ohx5/AADmFkWh06vkM3wDsR0P6g_ha?dl=0") Cycler - | (2014) - p.desc An attempt to create a sleep cycle Android application. - .stack - span Product design - span Java - span Android - - li.project-card - span.title - a(href="https://www.dropbox.com/s/xc8kjswj4fb0m0z/presentation.pdf?dl=0") Anogram - | (2014) - p.desc A naive attempt to create an anonymous social network. - .stack - span Product design - span iOS - span PHP - - li.project-card - span.title - a(href="https://xgm.guru/p/ufs/index") UFS Arena - | (2012) - p.desc - | A Warcraft III™ custom map ( - a(href="https://www.dropbox.com/s/odxeaq62jaqvcdc/UFS.w3x?dl=0") source - | ). - dev.stack - span Product design - span GameDev - span cJASS diff --git a/cv.pug b/cv.pug deleted file mode 100644 index d71d735..0000000 --- a/cv.pug +++ /dev/null @@ -1,303 +0,0 @@ ---- -eleventyExcludeFromCollections: true -title: "CV" -description: "Curriculum vitae" -cover: /public/img/me.jpg ---- - -doctype html -html(lang='en') - head - include /head.pug - - //- Styles - link(rel='stylesheet' href='/public/styles/cv.css') - link(rel='stylesheet' href='/public/styles/posts.css') - link(rel='stylesheet' href='/public/styles/projects.css') - - style(lang="css"). - .history li { - line-height: 1.3; - } - - .history li:not(:last-child) { - margin-bottom: 0.5rem; - } - - body - include /header.pug - - main - section#about - h2 - | Curriculum vitae - - small(style="margin-top: -0.5em; opacity: 0.9" class="noprint") - | You can download generated PDF from - | - a(href="/public/VladFaust.com.pdf" title="Download") here - | . - - p - | Throughout my 10+ years of experience in Information Technology, - | - b I've tried everything - | - | from compiling COFF after LLIR lowering to designing a resilient ultra-scalable fleet of FAAS workers, from Substrate and IPFS to event-driven stock price prediction. - p - | Comprehending a technology is like surfing on the waves of technology trends, on the surface of the greatest whirlpool of singularity. Comprehension means fundamental, decomposed knowledge enough to build a solution at - | - b any scale - | . - p - | For me, it is not about thoroughly learning API of yet another web framework, it is instead getting hands on the set of tooling a technology offers, so that I may choose the - | - mark best framework suitable for the problem - | - | . If I were to compile my 10+ years of experience into one line, that would be the following: - big Right tooling is paramount. - p - | Here is an incomplete list of technologies I've had experience with, in the order of encounter, starting back in 2013: Pascal,  - a(href="https://wc3modding.info/pages/vjass-documentation/" target="_blank") vJass - | , cJass, C, C++, Java, git,  - a(href="https://libgdx.com/" target="_blank") LibGDX - | , PHP,  - a(href="https://unity.com/" target="_blank") Unity - | , C#, Ruby, Telegram,  - a(href="https://www.heroku.com/" target="_blank") Heroku - | ,  - a(href="https://dokku.com/" target="_blank") Dokku - | , SQLite, PostgreSQL, Redis, Docker, JavaScript, Gulp, Grunt, Ruby On Rails,  - a(href="https://hanamirb.org/" target="_blank") Hanami - | ,  - a(href="https://roda.jeremyevans.net/" target="_blank") Roda - | ,   - a(href="https://sequel.jeremyevans.net/" target="_blank") Sequel - | ,  - a(href="https://crystal-lang.org/" target="_blank") Crystal - | , LLVM, Kubernetes,  - a(href="https://firecracker-microvm.github.io/" target="_blank") Firecracker - | ,  - a(href="http://www.tinycorelinux.net/" target="_blank") Tiny Core Linux - | ,  - a(href="https://buildpacks.io/" target="_blank") buildpacks.io - | , compiler development, machine learning,  - a(href="https://www.tensorflow.org/" target="_blank") Tensorflow - | , VueJS, TypeScript,  - a(href="https://deno.land/" target="_blank") Deno - | ,  - a(href="https://ziglang.org/" target="_blank") Zig - | ,  - a(href="https://en.wikipedia.org/wiki/Parsing_expression_grammar" target="_blank") PEG - | , Rust, EVM, Solidity,  - a(href="https://substrate.io/" target="_blank") Substrate - | ,  - a(href="https://ipfs.io") IPFS - | ,  - a(href="https://en.wikipedia.org/wiki/Zero-knowledge_proof") ZKP - | , ChatGPT, llama.cpp, Godot,  - a(href="https://trpc.io/docs/subscriptions") tRPC - | ,  - a(href="https://zod.dev") Zod - | ,  - a(href="https://tanstack.com/") Tanstack - | ... - ul.history(style="align-self: start;") - li - b 2013: - | - | It all began with Warcraft®️ III™️ maps, such as  - a(href="https://xgm.guru/p/ufs/index" target="_blank") UFS Arena - | . I did all the - | - b coding - | - | (cJass, a C-like domain-specific language) and - | - b design - | , and my maps gained some popularity in the Russian-speaking community. - li - b 2014: - | - | First steps in commercial product development:  - a(href="https://www.dropbox.com/s/xc8kjswj4fb0m0z/presentation.pdf?dl=0" target="_blank") Anogram - | , a social anonymous service project. I did the - | - b design and backend coding - | - |in PHP. Unfortunately, the trend had quickly detoriated. - li - b 2015: - ul - li - | In 2015, I released an Android game called - | - a(href="https://www.moddb.com/games/jumpin-sweeties/videos/trailer" target="_blank") Jumpin Sweeties - | , written with - | - b LibGDX - | . My family and friends liked it, but it didn't gain much traction. - li - | With - | - b Ruby on Rails - | , I created a Bitcoin service for SMS number confirmations based on Google Voice, and after a couple of months sold it to a foreign customer for a good price. This marked the beginning of my journey as a - | - b solo entrepreneur - | . - li - b 2016: - ul - li - | This was the year of - | - b Telegram bots - | - | for me. First, I created - | - a(href="https://profitrobot.me/" target="_blank") @profitrobot - | , which climbed pretty hign in the bot store rating. The bot allowed users to earn lunch money by completing CPA tasks and watching advertisements. Profitrobot became - | - a(href="/public/img/posts/2020-08-07-hello-world/bot-a-users-graph.jpg") quite popular, - | - | and I managed to sell it to another entrepreneur. - li - | In parallel I worked on - | - a(href="https://t.me/soundmemesbot" target="_blank") @soundememesbot - | , which allowed its users to post sound memes in chats. Long story short, the bot became - | - mark massively popular all around the world - | , but I did struggle to monetize it. Required moderation efforts made me shut it down. - li - b 2017: - | - | Not all the projects are destined to become viable, such that was  - a(href="https://telegra.ph/CashbackBot-09-16" target="_blank") CashbackBot - | , a Telegram bot for - | - b cashback services - | . I've spent a lot of time building it, but the project was never launched, nor it was sold. - li - b 2018: - | - | This year marked the beggining of my two-years journey in the - | - a(href="https://crystal-lang.org/" target="_blank") Crystal programming language - | - | ecosystem. I loved being a part of - | - mark open-source - | - | (check out my - | - a(href="https://github.com/vladfaust") GitHub - | !). I created many libraries, including - | - a(href="https://github.com/onyxframework/http") web framework - | - | and - | - a(href="https://github.com/onyxframework/sql") ORM - | , and even - | - b contributed into the language - | - | itself. Also check out my - | - a(href="https://medium.com/@vladfaust/sorbet-is-cool-but-crystal-is-smoother-d16f4a920108" target="_blank") article - | - | comparing Crystal to Stripe's Sorbet. - li - b 2020: - | - | By 2020, I was fed with all the imperfections of the Crystal ecosystem, and decided to move and build - | - mark my own programming language - | , Onyx. Oh, that was a ride. Long story short, too much for a single person. Yet, - | - b an enormous amount of computer science experience - | - | gained. Just look at the plethora of Onyx compilers I was working on: - | - a(href="https://github.com/fancysofthq/phoenix") C++ - | , - | - a(href="https://github.com/onyxlang/rs") Rust - | - | and even - | - a(href="https://github.com/onyxlang/ts") TypeScript with Zig - | ! The - | - a(href="/posts/2020-08-16-system-programming-in-2k20/") System Programming in 2k20 - | - | article is still one of the best I've written. - li - b 2021: - | - | - mark Senior Crystal developer - | - | at - | - a(href="https://brightsec.com/" target="_blank") NeuraLegion - | , an Israeli web security company. Nothing fancy, just some good old JSON APIs. - li - b 2022: - | - | I was employed by - | - a(href="https://byzantine.solutions/" target="_blank") Byzantine.Solutions - | - | on the role of a - | - mark Technical Due Diligence Officer - | - | . I inspected and contributed to some of the biggest crypto projects of that time. I also did some crypto-related projects of my own (see below). - li - b 2023: - | - | The epiphany of AI had occured, my mind has cracked, and I've lost the sense of what is past and what is future. Yet I managed to work on some private AI projects at the role of a - | - mark full-stack+prompt engineer - | . - - p - | Check out my - | - a(href="https://wakatime.com/@vladfaust" target="_blank") profile at Wakatime - | ; since I've began tracking my time in 2018, I've coded over 7000 hours, resulting in 1000 hours a year average. Take a look at this glorious chart of my favorite languages: - - figure(style="width: 100%") - embed(src="https://wakatime.com/share/@vladfaust/92441f4f-e368-4bc3-a53b-9a3100aaa45c.svg") - - p - | Currently I'm working on private - | - mark AI character simulation - | - | projects. My best stack is prompt engineering, custom AI model deployment, Rust, C++, Typescript, VueJS, NodeJS, tRPC, Zod and Tanstack. - - p - | See my blog posts (especially the - | - a(href="/posts/2020-08-07-hello-world") personal introduction - | ) and projects below, check my - | - a(href="https://github.com/vladfaust") GitHub profile - | , find my contacts in the header, and feel free to reach out if you want to work with me. - p - | Sincerely, - br - | Vlad. - - section#posts - h2 Recent blog posts - include /posts.pug - - section#projects - h2 Project list - include /projects.pug - - include /footer.pug diff --git a/gulpfile.js b/gulpfile.js deleted file mode 100644 index eb40700..0000000 --- a/gulpfile.js +++ /dev/null @@ -1,48 +0,0 @@ -const { watch, src, dest, parallel, series } = require("gulp") -const asciidoctor = require("@asciidoctor/gulp-asciidoctor") -const grayMatter = require("gulp-gray-matter") -const tap = require("gulp-tap") -const rename = require("gulp-rename") - -function convertAdoc () { - return src("notes/**/*.adoc") - .pipe(grayMatter()) - .pipe(asciidoctor({ - standalone: false - })) - .pipe(tap(function(file) { - file.contents = Buffer.concat([ - new Buffer("---\nasciiDoctor: true\ntemplateEngineOverride: false\n---\n"), - file.contents - ]) - })) - .pipe(dest("notes")) -} - -function extractFrontMatterFromAdoc () { - return src("notes/**/*.adoc") - .pipe(grayMatter()) - .pipe(tap(function(file) { - file.contents = new Buffer(JSON.stringify(file.data)) - })) - .pipe(rename(function(path) { - path.extname = ".11tydata.json"; - })) - .pipe(dest("notes")) -} - -function processAdoc (cb) { - parallel( - convertAdoc, - extractFrontMatterFromAdoc)(cb) -} - -function watchAdoc () { - watch('notes/**/*.adoc', processAdoc) -}; - -exports.processAdoc = processAdoc; - -exports.default = parallel( - processAdoc, - watchAdoc) diff --git a/index.html b/index.html new file mode 100644 index 0000000..ba6910d --- /dev/null +++ b/index.html @@ -0,0 +1,39 @@ + + + + + + + Vlad Faust + + + +

+ Hello, my name is Vlad Faust. + I am a wandering buddhist monk. +

+

Socials

+ +

Donations

+ + + + diff --git a/index.pug b/index.pug deleted file mode 100644 index 169fa01..0000000 --- a/index.pug +++ /dev/null @@ -1,30 +0,0 @@ ---- -eleventyExcludeFromCollections: true -title: "Vlad Faust" -titleNoAppend: true -description: "My personal website" -cover: /public/img/me.jpg ---- - -doctype html -html(lang='en') - head - include /head.pug - - //- Styles - link(rel='stylesheet' href='/public/styles/index.css') - link(rel='stylesheet' href='/public/styles/posts.css') - link(rel='stylesheet' href='/public/styles/projects.css') - body - include /header.pug - - main - section#posts - h2 Recent blog posts - include /posts.pug - - section#projects - h2 Project list - include /projects.pug - - include /footer.pug diff --git a/package.json b/package.json deleted file mode 100644 index 2dd52f4..0000000 --- a/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "blog", - "version": "1.0.0", - "description": "", - "main": "index.js", - "private": "true", - "scripts": { - "debug": "DEBUG=* npx @11ty/eleventy", - "dev": "npx concurrently \"npx gulp\" \"npx @11ty/eleventy --serve --port 8082\"", - "build": "npx gulp processAdoc && npx @11ty/eleventy" - }, - "keywords": [], - "author": "Vlad Faust ", - "license": "None", - "devDependencies": { - "@11ty/eleventy": "^0.11.0", - "@11ty/eleventy-plugin-syntaxhighlight": "^3.0.1", - "@asciidoctor/gulp-asciidoctor": "^2.2.5", - "asciidoctor.js": "1.5.9", - "gulp": "^4.0.2", - "gulp-gray-matter": "^3.0.1", - "gulp-rename": "^2.0.0", - "gulp-tap": "^2.0.0", - "markdown-it-anchor": "^5.3.0", - "markdown-it-attrs": "^3.0.3", - "markdown-it-container": "^3.0.0", - "markdown-it-footnote": "^3.0.2", - "markdown-it-implicit-figures": "^0.10.0", - "markdown-it-imsize": "^2.0.1", - "markdown-it-sub": "^1.0.0", - "markdown-it-sup": "^1.0.0", - "markdown-it-toc-done-right": "^4.1.0" - } -} diff --git a/posts/2020-08-07-hello-world.md b/posts/2020-08-07-hello-world.md deleted file mode 100644 index 788e803..0000000 --- a/posts/2020-08-07-hello-world.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: Hello, World! -location: Moscow, Russia -excerpt: How many years of programming experience is needed to be qualified to start a tech blog? Time for an introductory post! -cover: /public/img/me.jpg -ogType: article ---- - -How many years of programming experience is needed to be qualified to start a tech blog? -Ten, fifteen? -I see much blogging even with [zero](https://dev.to/), so I decided to give it a try as well. - -Time for an introductory post! - -## I - -I is Vlad Faust. - -I started programming when I was 15, and now [I'm 24](https://www.youtube.com/watch?v=oO3YmT2d-8k){.secret-link}. - -I've gone through many programming environments, from triggers/vJass/cJass in Warcraft® III [custom](https://xgm.guru/p/wc3/headhunter), [maps](https://xgm.guru/p/ufs), to developing and [implementing](https://github.com/fancysofthq/nxc) a [currently-being-standardized](https://nxsf.org/) programming language. - -I've programmed in Pascal, [~~php~~](https://bitbucket.org/vladfaust/anogram-api/src/master){.secret-link style="opacity: 50%;"}, [Java](https://bitbucket.org/vladfaust/jumpinsweeties/src/master/){.secret-link}, Ruby, Javascript, C, C++, C#, C`!@#$%`, C`( ͡° ͜ʖ ͡°)` and many, many more. - -I've created a [game](https://www.moddb.com/games/jumpin-sweeties/videos/trailer) in [LibGDX](https://libgdx.badlogicgames.com/), launched a number of Telegram bots, some of which [did](/public/img/posts/2020-08-07-hello-world/bot-a-users-graph.jpg), [become](/public/img/posts/2020-08-07-hello-world/bot-b-reviews.jpg), [popular](https://t.me/soundmemes/61). - -I've also designed some [other](https://4pda.ru/forum/index.php?showtopic=571231), [games](https://apkpure.com/ruble-fate-raise-the-rouble/com.faustapps.rublefate) and [projects](https://www.dropbox.com/s/xc8kjswj4fb0m0z/presentation.pdf?dl=0). - -
- -In 2016, I fell in love with Ruby with the help of the famous the Michael the Hartl's the [Ruby on Rails Tutorial](https://www.railstutorial.org/), and then even open-sourced some very useful gems: - - * [Jbuilder::JsonApi](https://github.com/vladfaust/jbuilder-json_api) - * [AssetPipeline](https://github.com/vladfaust/asset_pipeline) - * [SmsActivate](https://github.com/vladfaust/sms_activate) - * [Bitcoinpay](https://github.com/vladfaust/bitcoinpay-client) - * [Blockchain::Api](https://github.com/vladfaust/blockchain-api) - -I did truly enjoy Ruby on Rails, but after some time, I began wondering if there were more performant alternatives. -So I went from Rails to Hanami, and then to Roda and Sequel, and then occasionally run into Assembler [Crystal](https://crystal-lang.org/). - -I instantly got _addicted to Crystal_. -Throughout the next two years, I've developed a number of very useful shards: - - * [TimeFormat](https://github.com/vladfaust/time_format.cr) - * [I18n](https://github.com/vladfaust/i18n.cr) - * [HTTP::Multiserver](https://github.com/vladfaust/http-multiserver.cr) - * [Tarantool](https://github.com/vladfaust/tarantool.cr) - * [Cake-Bake](https://github.com/vladfaust/cake-bake) - * [Callbacks](https://github.com/vladfaust/callbacks.cr) - * [Validations](https://github.com/vladfaust/validations.cr) - * [MiniRedis](https://github.com/vladfaust/mini_redis) - * [HTTP::Params::Serializable](https://github.com/vladfaust/http-params-serializable) - * [Migrate](https://github.com/vladfaust/migrate.cr) - * [Stripe](https://github.com/vladfaust/stripe.cr) - -I even managed to build my [own web framework](https://onyxframework.com/) featuring a [REST server](https://onyxframework.com/http), a database-agnostic [SQL ORM](https://onyxframework.com/sql) and even an [EDA platform](https://onyxframework.com/eda)! -I've also built a (now defunct) [Crystal Jobs](https://github.com/crystaljobs) website and the [RealWorld implementation](https://github.com/vladfaust/crystalworld) in Crystal. - -Unfortunately for Crystal, I've left the Crystal ecosystem, because this is not the language I've always dreamt of. -And because of [some](https://github.com/asterite){.secret-link} [other](https://github.com/RX14){.secret-link} reasons, but more on that later. - -In June 2019, I began working on my own programming language, [Onyx](/posts/2020-08-20-the-onyx-programming-language). -As of August 2020, it's been more than a year of fighting dragons new knowledge and experiences. - -I invite you all to follow me on this journey. - -![This journey...](../../../public/img/posts/2020-08-07-hello-world/iceberg.png =100%x) - -## Am Only Human - -Apart from programming, I used to enjoy heavy-lifting in a local gym. -It is not possible now do to [Carpal tunnel syndrome](https://en.wikipedia.org/wiki/Carpal_tunnel_syndrome) I've got the last year. -Please do not let that happen to you! -_Update (2021):_ the illness has gone. - -Me love playing computer and board games with my imaginary friends. -My favourite PC games include C&C series, TES series, S.T.A.L.K.E.R. series, Bulletstorm, Carmageddon and [many more](https://store.steampowered.com/app/331470/Everlasting_Summer/){.secret-link}. -I'm always happy to play some [Project Winter](https://store.steampowered.com/app/774861/Project_Winter/) with you guys, PM me for a Discord invite! -Anyone? - -Human creation is what I enjoy a lot. -I love listening to good music and examine great drawings. -I can play ukulele and willing to learn the piano and singing. -I'm also experimenting with 3D modelling and digital art. - -> [I'll try anything once.](https://gamepedia.cursecdn.com/overwatch_gamepedia/8/81/Echo_-_I%27ll_try_anything_once.ogg){.secret-link} - -Sometime in the future, I plan to work on a strong AI implementation, which you can share music and watch movies together with. -This is where [Onyx](/posts/2020-08-20-the-onyx-programming-language) comes into play! - -As a pragmatic person, I wrote some seemingly depressive articles "revealing the truth": - - * [Твой Дзен: Я](https://telegra.ph/Tvoj-Dzen-YA-07-04) - * [Твой Дзен: Они](https://telegra.ph/Tvoj-Dzen-Oni-07-04) - * [И целого мира не надо](https://telegra.ph/%D0%98-%D1%86%D0%B5%D0%BB%D0%BE%D0%B3%D0%BE-%D0%BC%D0%B8%D1%80%D0%B0-%D0%BD%D0%B5-%D0%BD%D0%B0%D0%B4%D0%BE-12-16) - -On my 24^th^ birthday, I've recorded a [video](https://www.youtube.com/watch?v=qCdGP15vGEc) (in English) accumulating my thoughts on the world and my place in it. - ----- - -I think that's enough for an introductory post. -Now you know a little bit more about yours truly. - -See you around,
diff --git a/posts/2020-08-16-system-programming-in-2k20.md b/posts/2020-08-16-system-programming-in-2k20.md deleted file mode 100644 index 12eb7fd..0000000 --- a/posts/2020-08-16-system-programming-in-2k20.md +++ /dev/null @@ -1,792 +0,0 @@ ---- -title: System Programming in 2k20 -location: Moscow, Russia -excerpt: System programming seems to be much harder than application programming. Why is that and how to overcome this? -cover: /public/img/posts/2020-08-16-system-programming-in-2k20/state-therof.jpg -ogType: article ---- - -System programming is still essential, but it seems to be much harder than application programming. -Why is that and how to overcome this -- these are the questions I'll try to find answers for in this article. - - - -

Table of Contents

- -${toc} - -## Introduction - -A hundred years ago, a person could not imagine to be able to play any musical instrument they want, to create new interactive worlds, or to launch cars into space. -Life was simply not enough. - -Then the machines came. -Silicon computations allowed us, mere mortals, prolong our lives virtually and literally. - -Music creation software, game development engines, 2D and 3D editors, neural networks, AI and machine learning, motion capturing, navigation, medicine, wearable devices, smartphones... -Thanks to these, a person now can do a lot of things while having more free time during their lifespan. - -It all happened because a human learned to communicate with machines with means of programming languages. -Early inventors of the future were brilliant people able to coin fundamentally new concepts which last until today. - -But this is the how the humanity evolves: we accumulate knowledge and pack, shortcut it. -We don't need to keep in head proofs of every mathematical theorem, and we don't need to fully understand the nature of an axiom. -Instead, we store theorem and axiom statements. -With that in mind, we have more space to solve new problems. - -The same applies to programming. -Those brilliant people inevitably become old, as real system programming knowledge fades away. -On the surface, the amount of those who really understand how machines work seems to shrink. - -
- - -
Hey, that's me!
-
- -"But I can run a newural network with Python!", one would argue. -Well, who do you think develops TensorFlow itself? -TensorFlow [isn't written in Python](https://github.com/tensorflow/tensorflow), kid. - -Writing a game in Lua or Ruby is totally possible, as well as creating a messenger or code editor in Electron. -However, Electron, as any mature game engines, are still written in [C++](https://github.com/electron/electron). - -Almost any meaningful software which needs to utilize a machine with more than [20%](https://en.wikipedia.org/wiki/Pareto_principle){.secret-link} efficiency, is written in a system programming language. - -::: hero - -System programming is the foundation of the development of the human civilization.{style="font-size: 2.25rem"} - -::: - -Regardless of its importance, system programming seems to be less popular than application programming, because it's known to be harder to both learn and master. -It is definitely easier to spin up a web server, connect it to a database, set up some Stripe integration, drink a smoothie and proudly call yourself an entrepreneur. - -But that does not invest in the human civilization's progress on the Kardashov's scale. -The humanity will still depend on system programming in the foreseeable future. -And we need new, fresh blood there. - -In this article, I'll try to take a peek on the current state of the system programming, find out why it's not that popular and choose the best system programming language for the Next Big But Fairly-Low-Level Project (tm). - -## Choosing the Right Language - -When choosing a serious language for serious system programming, the choice is broad: it's either C, C++, Rust, or one of the many new LLVM-based projects. - -### C - -C is excellent at its simplicity, but bigger projects require higher-level language features, such as [memory control](https://twitter.com/jfbastien/status/1289305925199650816), object hierarchy, lambdas etc.; therefore, C is out of competition here. - -Ditto applies to C "replacements", such as [Ẕ̴̰̥̔͝i̷̥̣̍̓̉ġ̷̢̪͌̾́](https://ziglang.org/) and [Patreon-lang](https://vlang.io/). - -### C++ - -C++ is the grandfather of higher-level system programming. - -It offers powerful features with a grain of Unix epoch practices and a great amount of undefined behaviour. -Funnily enough, an experienced C++ programmer shall aware of not what C++ is, but of what it is not, i.e. undefined behaviour of the language. - -That said, developing on C++ is pain, and it is easy to shoot your lower parts off by, say, returning a lambda with a closured local variable. -Of course, it is possible to have a fancy third-party UB checking tool, but such a tool would never be perfect considering the amount of UB in the language itself. - -![Relatable AF](../../../public/img/posts/2020-08-16-system-programming-in-2k20/thinking-about-meme.jpg =100%x) - -Another Unix anachronism C++ inherits is the backwards compatibility with a bitter taste of Postel's law: "most compilers implement that feature in different ways, let's put it into the language after a short thought with design averaging from existing implementations!". -One may argue that backwards compatibility is a good thing, but let me postpone this discussion for a [later section](#backwards-compatibility) of this article. - -### Rust, pt. 1 - -Rust is a fairly young programming language with a reputable mission: empower everyone to build reliable and efficient software. -Let's deconstruct the statement. - -One of the game-changing features of Rust is the separation between safe and unsafe code. -The ability to isolate volatile code worths a lot: if anything goes wrong, then you simply `grep` your codebase with `unsafe` filter and voilà -- all the dangerous invocations are at your hand sight. -It also allows _the_ implementation to perform crazy optimizations, say, by entirely removing parts of code; and it's fine because there is no unsafe access to that code. -As a result, focusing on volatile code becomes easier, and nasty bugs are squashed faster. - -Otherwise, _the_ Rust compiler would yell at you, pointing at your mistakes in the safe code area. -And those yells are detailed enough, so most of the time you have a clear picture on why you're wrong and what to do with that. - -Compared to C++, Rust compilation process is much friendlier and catches more bugs before you face them in runtime. - -![I just wanted to sort an array](/public/img/posts/2020-08-16-system-programming-in-2k20/errors-in-langs.jpg "How different compilers react to user errors" =100%x) - -Another good thing about Rust is macros. -Well, what's good is the idea of macros; the implementation of macros in Rust is um... questionable. -Nevertheless, macros allow writing code in code with much greater flexibility than with C++ preprocessor and constant expressions. -Nuff said, macros are must-have in modern languages. - -The built-in crates system Rust has brings powerful abstractions into the ecosystem. -Those folks enjoying lower-level programming and having enough skills to do so can wrap unsafe, but performant code, into simple, but safe abstractions. -And those who have a need to just make things work, may (comparably) [easy adopt those crates](https://www.theregister.com/2020/01/21/rust_actix_web_framework_maintainer_quits/). - ----- - - - -Rust really does allow to build _reliable_ (no undefined behaviour in-the-wild) and _efficient_ (thanks to the zero-cost philosophy) software to _everyone_ (with powerful abstractions). - -But, there are always some "butts". - -First of all, only a few may say Rust has friendly syntax. -In the maniacal pursuit for the absolute memory safety, the language introduces plethora of abstractions such as borrow checker, six string types (hey, we're making a language here, not a guitar), `Mut`, `Box`, `Arc`, `Trait`, requiring to do those ubiquitous `unwrap()`, `as_ref()` and `borrow()` (often chained) literally before every access. - -Some may call it "hipster thinking", but those small spikes like mandatory semicolons\*, curly brackets wrapping, and otherwise unintuitive design decisions like constantly "screaming code" with ubiquitous bangs (`!`) and overloaded documentation semantics — they make writing and reading Rust code harder. -Definitely harder than Ruby or, say, -J̸̧̨̹͈̦̏̅͒̈́͂͐̄̾͟͟ͅȃ̡͎̯̟̦͉͂͊̿̈́v̢̡͖͍̻̳̞͌͌̈̋̐͌̆͜a̴͖̱̟̩̹̘̺͊̃̋̇̾̀̀͐̊͐ͅS̶͚̣̥͚͈̥̤͔̾̎̎̿̔͊̋̉̓c̶̡̧̗̻̊̈̋̍̔̂̅̓̚͘͢ŗ̰͖̲̙͖͕̂̏̍͑̊̋ḯ̸̛̤̦̠͈̩̙̯̘̥̖̅́̊̀͑̕͠͠p̸̨̧̨̧̡̛̮̯͖̹͈̉̑̿͛̎̀͌̾͞ț̸̩͕͈̊͐̏̏̕͡ͅ -. - - -::: off - -\* In fact, semicolons are not mandatory -_everywhere_ -, which brings even more confusion. - -From [StackOverflow](https://stackoverflow.com/questions/26665471/are-semicolons-optional-in-rust): - -> Semicolons are generally not optional, but there are a few situations where they are. Namely after control expressions like `for`, `if/else`, `match`, etc. - -[Bruh.](https://www.myinstants.com/media/sounds/movie_1.mp3){.secret-link} - -::: - -A [wise man](https://en.wikipedia.org/wiki/Jason_Statham){.secret-link} once said: - -> The complexity of a language feature is proportional to the number of articles explaining the feature. - -Here go a tiny fraction of reads on why Rust is not even nearly to an intuitive language: - - 1. [Common Rust Lifetime Misconceptions](https://github.com/pretzelhammer/rust-blog/blob/master/posts/common-rust-lifetime-misconceptions.md) - - 1. [What Not to Do in Rust](https://blog.sentry.io/2018/04/05/you-cant-rust-that?utm_content=137995710) - - 1. [Frustrated? It's not you, it's Rust](https://fasterthanli.me/articles/frustrated-its-not-you-its-rust) - - 1. [Understanding lifetimes](https://www.reddit.com/r/rust/comments/ic67tm/understanding_lifetimes/) (the subreddit itself is straight proof of how insanely complex the language is) - - 1. [Understand smart pointers in Rust -](https://stackoverflow.com/questions/55075458/understand-smart-pointers-in-rust) (the StackOverflow tag is full of that gold) - - 1. [Clear explanation of Rust’s module system](http://www.sheshbabu.com/posts/rust-module-system/) - -The following is my personal collection of "why I love Rust". - -::: spoiler ⚠️ Lots of nasty tweets inside - -
- - -
No, it does not
-
- -
- - -
You'd better start with coffee
-
- -
- - -
That's alright, they find a way to reduce it in the replies
-
- -
- - -
Those signatures tho
-
- -
- - -
ditto
-
- -
- - -
Did someone said "macros"?
-
- -
- - -
What. The. Fuck.
-
- -::: - -And sorry for these (you can open them in a new tab to enlarge (but please don't)). - -![](../../../public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-1.jpg =100%x) -![](../../../public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-2.jpg =100%x) -![](../../../public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-3.jpg =100%x) - ----- - -Rust is more confusing than C++, change my mind. -On the one side, _the_ compiler is always watching your moves, and it is responsible for ensuring protection from undefined behaviour... -But that power comes at the price of unfriendly, clumsy, cumbersome syntax with lots of unintuitive abstractions and repetitive actions. -Now, instead of keeping in mind of where C++ might blow, one shall be aware all the abstractions Rust brings in to choose the right one, and where to place a semicolon. - -That said, the "for everyone" clause in the mission statement seems unfair to me now. -It takes great effort to become fluent in Rust. - -Regarding other two clauses in the Rust's mission, I still have no claims on them. -Rust programs are known to be reasonably performant (if you ever manage to wait until `rustc` compiles with optimizations turned on), and there is even the academia-grade [RustBelt](https://plv.mpi-sws.org/rustbelt/) organization ensuring the UB-safety. - -You can always find more on what's the good, the bad and the ugly about Rust, but the main point is that the language is not ideal, and there is definitely room for improvements. -Plus one point to the justifying. - -### Challengers Worth Mentioning - -There are some other noteworthy languages, which nevertheless do not fit my requirements for [various reasons](https://en.wikipedia.org/wiki/Not_invented_here). - -#### Julia - -[Julia](https://julialang.org/) is quite a mature language focused on **scientific research**. - -First of all, I'm interested in a general-purpose language. -I want to be able to create mainstream GUI applications, microservices and 3D engines, while Julia is focused on multi-dimensional arrays and plots. - -::: spoiler Second of all, - -![This](../../../public/img/posts/2020-08-16-system-programming-in-2k20/jit-is-slow.jpg "JIT is slow meme" =70%x) - -::: - -You can find more on why not Julia [here](https://www.zverovich.net/2016/05/13/giving-up-on-julia.html), with critique addressed [here](https://www.reddit.com/r/Julia/comments/629qkz/about_a_year_ago_an_article_titled_giving_up_on/). - -Check out [another hilarious post](https://discourse.julialang.org/t/get-it-together-guys/27826) on this matter. -I personally love this quote: - -> Get a job! Then paint your masterpiece. - -Telling that to a scientific language developed in MIT by scientists... -Well, more on that later. - -#### Nim - -[Nim](https://nim-lang.org/) claims that it is a system programming language, but it currently lacks support for some lower-level features like alignment and address spacing. -One still has to wrap a C/C++ library or write inline C/C++ for low-level programming, e.g. on a GPU. -In that sense, Nim is similar to Python and other higher-level languages with FFI. - -In addition to that, - - * Nim lacks proper [object-oriented features](https://nim-lang.org/docs/tut2.html#object-oriented-programming) like interfaces and mixins. - OOP is crucial for a big project, change my mind. - - * Nim [does not have explicit safety concepts](https://github.com/nim-lang/Nim/wiki/Unofficial-FAQ#is-nim-unsafe). - - * Nim has Python-like indentation-based syntax with lines ending in `=` and `:`, which is **subjectively** worse than Ruby-like syntax. - Also the `import` semantic inherited from Python is fundamentally different from Ruby's `require`, and all the macros and generics semantics to be proposed becomes cumbersome to use with `import`s. - -#### Crystal - -I love the core idea behind Crystal. -I don't like its implementation. - -They are saying that [Crystal](https://crystal-lang.org/) is a general-purpose programming language, but that's not true. -The language and its core team are focused on their needs, which is solely an `amd64-linux` platform. - -The standard library is bloated with heavy dependencies like `libxml` and `libyaml`, the language itself has GC, event loop and unwinding-based exceptions (i.e. a runtime) built-in, and it's therefore hardly possible to ship an executable for purposes other than serving requests over HTTP. - -After almost 10 years in development, the core team still has disagreements in the fundamental design, and you may commonly see controversial claims by its officials regarding Crystal's future on the forum. -They even can not decide if Crystal is a compiled Ruby or something else. - - - -Regarding the number of bugs the only implementation has... -Once you dig a little bit deeper, it all begins to explode. -Macros, generics, unions, interoperability: it may blow up anywhere. -A core team [representative](https://github.com/asterite){.secret-link} without "core team" badge will then appear telling you that it's not a bug, or wait, it is a bug, but it can not be fixed, oh wait, it can be fixed, but it's not a bug, issue closed, thanks. - - - -The recently introduced multi-threading brings even more problems due to the lack of proper addressing of the data races in the language. -As most of the other design decisions in Crystal, this one has been taken somewhere in Manas without any open discussion. - -I've spent two years in the Crystal ecosystem, and it did not move forward a bit, only backwards (bye, [Serdar](https://twitter.com/sdogruyol), bye [Julien](https://twitter.com/ysbaddaden)). -A brilliant idea is buried by lack of focusing on the community needs. -A hard lesson to learn. -It's time for (_spoiler alert_) Crystal done right. - -## Backwards Compatibility - -One would now jump into proudly announcing another language they've come up with, a utopia-grade solution to replace both C++ and Rust once and forever. - -But the "forever" claim is kinda sloppy. - -Remember how I mentioned earlier that backwards compatibility is not _that_ good? -The truth is that there will always be unforeseeable new features at some point, which have to be implemented, so a language stays competitive. -For example, coroutines, a term coined in 1958, were not much of interest until 2010's... - -A product aiming to preserve backwards compatibility has to somehow insert new features into existing rules without introducing breaking changes. - -C++ is an excellent primer on how not to. -Constrained by existing implementations, they add overly complicated `co_await` functionality into the standard library with extra garbage, which instead should have been built into the language itself (the functionality, not the garbage). - -Another ad-hoc example is C++20 concepts. -Instead of allowing to restrict generic arguments in-place, a new `requires` syntax is added, which is quite cumbersome: see [this](https://akrzemi1.wordpress.com/2020/01/29/requires-expression/) and [this](https://akrzemi1.wordpress.com/2020/03/26/requires-clause/). - -As the hardware evolves, new fundamental types come into play. -What's the state of support of SIMD vectors, tensors or half-precision floats in C++? Brain floats? -Oh please. -Instead of being incorporated into the standard, implementations come with their own solutions, which further invests into the chaos. - -But breaking changes are always painful, you would argue because on one side you want to use all the shiny new features, but on the other, you don't want to spend a dime rewriting your code. -It becomes even worse when an open-source library author you're depending on decides that they will not support the older major version of a language; or, instead, they won't move on to the newer version. - -Given the number of open-source libraries your project depends on, you are in trouble, as library versions become stale or incompatible. - -All that's left is to visit a library's bug tracker and leave a "what's the status of this?" or "+1" comment, or maybe even put a little bit more effort: - -[![I'm sorry for putting my Patreon account link in an MIT-licensed repository 😔](/public/img/posts/2020-08-16-system-programming-in-2k20/are-you-still-there.png "Are you still there??" =100%x)](https://github.com/vladfaust/unity-wakatime/issues/25) - -When deciding on which language to build your next big project™ in, what you (or your PM) really want is that it accounts for all the present and future software and hardware features, has ultimate performance, maintainability, and never introduces any breaking changes, so you constantly reap the rich choice of forever-actual libraries. - -Of course, such a language should be free as beer, as all of the forever-actual libraries. -What's the point otherwise? - -## Rust, pt. 2 - -Looks like Rust is the perfect candidate. - -In the famous [Rust: A Language for the Next 40 Years](https://www.youtube.com/watch?v=A3AdN7U24iU) talk, they say that Rust will never have a major breaking change, staying young version `~> 1` forever, but still evolving. - -Wait a minute. - -At 32:15, Carol says: - -> When I first heard of that idea, I thought it sounds terrible from the compiler maintenance point of view: you have to maintain two ways to use every feature forever because we wanted to commit to all editions being supported forever. But it's actually not that bad. - -Then they take a good thinking sip of water and prove that it is indeed that bad. - -[![MFW I realize something's wrong but the slides are already there (clickable)](../../../public/img/posts/2020-08-16-system-programming-in-2k20/carol-knows.png "Carol knows the truth" =100%x)](https://youtu.be/A3AdN7U24iU?t=1822) - -Effectively, the "forever `~> 1`" policy limits the number of fundamental features Rust MIR can have changed. -According to the talk, only a few keywords are to differ between editions. - -So what we have in the dry run is a never-really-changing language with some slightly-different dialects to support. -Occasionally, an implementation would opt-out of supporting an edition, and consequently all the libraries written in this edition become unusable. -No ecosystem split, huh? - -The editions problem could be addressed by supporting multiple editions in a single library. -But what if a library author you're depending on decides that they will not support a specific edition... -Um. - -> [Ever got that feeling of déjà vu?](https://static.wikia.nocookie.net/overwatch_gamepedia/images/c/c0/Tracer_-_Ever_get_that_feeling_of_d%C3%A9j%C3%A0_vu.ogg){.secret-link} - -Yes, we're back to breaking changes and supporting multiple incompatible major versions editions of a language. -Oh those lazy open-source, free, OSI-licensed library maintainer bastards, they are the evil root of all the problems! - -## On Open-Source Sustainability - -For some, programming is just a job. - -For others, programming is a form of artistic expression. -For artists, writing open-source software facilitates the top two levels of the Maslow's hierarchy: self-actualization and esteem. -They enjoy writing clean, well-documented code, so anyone using it could feel the same. - -Guess who creates (a significant portion of) quality open-source software? - -![Us, the artists!](../../../public/img/posts/2020-08-16-system-programming-in-2k20/it-was-me.jpg =100%x) - -The above certainly applies to me. - -I used to maintain a [number](https://github.com/vladfaust?tab=repositories&q=&type=&language=crystal) of Crystal projects, most of which were well-documented and optimally performant. -I enjoyed writing [documentation](http://github.vladfaust.com/mini_redis/index.html) and [compiling changelogs](https://github.com/vladfaust/mini_redis/releases/tag/v0.2.0). -I even enjoyed [replying to issues](https://github.com/vladfaust/unity-wakatime/issues/25), to reveal [unexpected use-cases](https://github.com/vladfaust/migrate.cr/issues/12), [add new features](https://github.com/vladfaust/unity-wakatime/pull/11) and [squash bugs](https://github.com/vladfaust/unity-wakatime/pull/23) together. - -The greatest project of mine in Crystal was the [Onyx Framework](https://onyxframework.com), a web framework comprised of a REST server, a database-agnostic SQL ORM and even EDA facilities. -I was planning to also implement a GraphQL framework module, and a convenient CLI to ease the development process. -Objectively, it is more user-friendly, a better balanced between features and usability, than alternatives. - -You can find out more about my journey in programming in the [introductory post](/posts/2020-08-07-hello-world/). - -### Primitive Needs to Be Ashamed Of - -An artist, like any other human, has more needs to satisfy, though. -These are safety and psychological needs. -In other words, a man gotta pay his bills. - -Was I able to pay my rent with open-sourcing? - -> [LOL, haha!](https://static.wikia.nocookie.net/overwatch_gamepedia/images/a/a4/D.Va_-_Lol.ogg){.secret-link} - -Nowadays, a senior iOS developer in Russia has a salary of about $4'000 (300'000₽), which is $25 per hour. - -At the best times, my salary as an Open-Source engineer was pathetic $70. - -![Earnings BEFORE TAX](/public/img/posts/2020-08-16-system-programming-in-2k20/patreon-income.png "A Patreon income graph with an extremum of $70" =100%x) - -I did receive some "tokens of appreciation" from companies a couple of times, but those were not regular, and I could certainly not have a decent living even with them. - -You may argue that it was my fault to choose a promising young language with sweet syntax and native performance to invest my time in, but reread this sentence. - ----- - -Is it easy to pay your bills when you're a poet? - -Poetry is a basic form of art, but only a few, from many talented, poets can make their living doing what they love. -Given the same talent level, it takes big luck to become recognized and earn enough to pay rent. - -Some poets may come to streets and start reciting their poetry, hoping for a dime donated. -Some are more than happy to be hired by a children book publishing company which needs lots of similar poems... -As the individualism fades away. - - - -There are several paths for an open-source maintainer: - - 1. To spend their time entirely for free. - 1. To spend their time entirely for free, but put a link to their pitiful $0.0002/week Liberapay account, which would inevitably infuriate some Rabadash8820. - It is also required to always wrap the links with "😂" emojis and constantly [feel bad](https://clips.twitch.tv/RacyImpossibleTubersWTRuck) about asking to compensate for your time. - The fuck? - 1. To sell their time as a software consultant and provide direct support for their libraries. - These are often sold under the donations sauce and imply the same shameful constraints. - 1. To choose one of the explicit business model paths, such as open-core, where the product is not an open-source anymore, but a real business with marketing, cold calls, email spam, free trials etc. - -Regarding working for free (paths 1 and 2), I love this quote by myself: - -> Companies rely on those spending their precious time for free in the hope of being hired by those companies. -> A Saṃsāra's circle to break. - -Compared to poetry, the consultancy path (3) is like giving interviews and explaining your poems to others verse-by-verse. Which is not that bad. -Although sometimes you want to spend your time on writing new poems instead of explaining the old ones. -Moreover, some precious time has already been put into an old poem and shall be compensated as well. -Musicians do not tend to give their already written songs for free, do they? - -Regarding an explicit business path (4), I believe that it has the same consequences for software as for poetry or music. -An artist starts to think about money more than art, which inevitably leads to worse quality. -For example, in the open-core model, a maintainer spends resources on consciously deciding which features are to be deleted from the "open" part, and how to glue them with the paid part. - -That being said, are there any other ways to sustain open-source, to make open-sourcing a _real job_? - -### Source-On-Demand - -For musicians, there are platforms like Spotify, where a listener pays a fixed amount of money regularly, and the platform pays a musician based on how popular they were during the period. - -Can it be applied to model open-source sustainability? - -One of the problems arising is how to determine the "popularity" of an open-source library. -Is that the number of unique downloads ("launches")? -Or maybe some sort of manually-triggered endorsements? - -Also, a library may still be useful, but too specific, hence not "popular". -Its maintenance would still require a comparable amount of resources. - -The solution may be an algorithm taking into consideration both downloads from, say, unique IP addresses, per month, and manual endorsement actions like claps on Medium. -Unfortunately, highly-narrowed, hence unpopular, libraries would still have to look for other sources of funding. - -Okay, this looks like a good plan. -But. -In the music world, an artist becoming obsessed with the number of streams rather than with the quality of their music, either loses its popularity or changes trends towards shitty lesser-quality music. - -![I don't know who is it](../../../public/img/posts/2020-08-16-system-programming-in-2k20/a-famous-mumbler.jpg "A 6ix9ine photo" =100%x) - -Could the same thing happen in the open-source world? -Yes. -A greedy (or lucky) programmer may create a ton of `is-even()`-like libraries to be occasionally present as a dependency in a plethora of libraries. -Do they deserve to be rewarded? -Absolutely. -They do create value recognized by dependants, and this shall be properly rewarded. -Does it make the overall situation worse? -Yes, because there eventually is a larger amount of libraries to be aware of and put into dependency lists. -Generally, the more dependencies there are, [the worse](https://blog.carlmjohnson.net/post/2020/avoid-dependencies/). - -::: spoiler A classic meme - -
- -
- -::: - -It is clear that value created by a single `is-even()` library is incomparable to value created by, say, a PostgreSQL driver depending on it. -It would be unfair to award a single "use" of an `is-even()` library equally to the driver "use". -How to clearly determine the value then? - -I bet on the number of characters in a library's source code, including those commented (because documentation matters) and in binary files. -As a result, it would be more profitable to release big libraries: a user would likely require only the files they need (making an overall library size irrelevant to the compilation time), but the algorithm would still count the total amount of lines of code in a library, regardless of which files are required. - -One may argue that such a design would encourage Indian-style coding, with lots of repetitions and other crazy practices. -But libraries are typically designed for reuse and continuous maintenance, which means periodically adding new bugs and removing features. -This is not a one-time freelance job. - -Even if one decides to go sneaky and publish lots of hardly maintainable code, then, well, they will lose the competition, because they will not be able to maintain the code themselves. - -Given a choice, a business shall choose a library whichever is maintained and documented better, and whichever compiles and runs faster. -This is not about music taste getting worse, when a user would continue listening to whatever shitty low-effort product is released. It is about clearly defined business needs when compile-time and runtime cost actual money. - -Moreover, when a maintainer has a decent user base paying the bills, hence reputation, they (a maintainer) would take on security [more seriously](https://qz.com/646467/how-one-programmer-broke-the-internet-by-deleting-a-tiny-piece-of-code/). - - - -The model seems win-win to me, at least theoretically. -I don't know if it would work in reality, but I guess it's worth trying. - -Let's call the model "source-on-demand". - -#### Impact On A Language - -Let's imagine we've solved the open-source sustainability problem by implementing a source-on-demand service for one language ecosystem. -What benefits would the language experience? - -A real market with healthy competition attracts new library authors and incentivizes the old ones to continue maintenance to stay competitive. -That means more libraries in general and less stale issues. - -A rich, constantly growing ecosystem attracts new developers, which in turn implement libraries for their own usage, and maybe occasionally publish them. - -**A healthy competition in the ecosystem frees the language from the backwards compatibility burden.** -Once it (the language) introduces a breaking change, it's up to library authors to support the new version. -If they decide to drop support for a major language version which is in use, others will likely take the spot. - -Wow. -Let's try applying the model to existing languages. - -#### A C++ Implementation - -_A crazy-looking old man with wild hair steps onto the scene._ - -Alright kids, now we're about to build a C++ library hosting service with the source-on-demand model. - -Where do we begin? -First of all, we need to look at existing solutions. -Okay, Google, `c++ package managers`. -[Here](https://stackoverflow.com/questions/27866965/does-c-have-a-package-manager-like-npm-pip-gem-etc) is the most voted answer on the matter: - -> _There seem to be a few though I've never used them._ - -Well, this is one of the first results a user looking for a C++ package manager stumbles into. -_Not great, not terrible._ - -Anyway, the only relevant (and alive) projects I could find are [Conan](https://conan.io/), [Buckaroo](https://buckaroo.pm/), [Hunter](https://github.com/cpp-pm/hunter), [VCPKG](https://github.com/Microsoft/vcpkg) and [Pacm](https://sourcey.com/pacm/). -Neither of which is centralized. -They all propose to either set up their own package server or download packages directly from sources. - -But what about observability? -How does one find C++ packages to use in their projects? -What I if want, for example, an HTTP server package? -My variants are either [Googling](https://lmgtfy.com/?q=c%2B%2B+http+server+library), [GitHubbing](https://github.com/search?q=c%2B%2B+http+library), asking on [Reddit](https://www.reddit.com/r/cpp/comments/cjj9t5/what_c_web_server_library_one_should_use_nowadays/), lurk through manually maintainted [lists of libs](https://en.cppreference.com/w/cpp/links/libs)... -There is definitely a pain to solve! - -::: off - -While working on this article, I've tried VCPKG, and it's pretty damn good in the current stage. -It has its problems like inability to select a compiler on Windows or select a compiler in principle, which leads to standard compatibility issues. -The latter is more of the loose- C++ -standard issue. - -::: - -Imagine a shiny new world order with a centralized repository of C++ libraries with good searching features, tags, compatibility information etc.! - -Would it actually change anything in current government C++? -I doubt so. - -C++ is archaic by itself! - -Breaking changes to C++ aren't possible even if a centralized on-demand library manager was solving the library funding problem. -There is no fresh blood in C++, most of the youngsters do not want to bear with poor design the language imposes by itself. -The amount of time needed to convince Stroustrup-aged C++ committee members to push breaking changes into the ISO-governed standard... -I don't think it's feasible by any means. - -Old people get older, and C++ software is becoming ancient history. -The new generation is not interested in supporting no legacy code unless well-well-paid. -What is happening with COBOL now is C++'s inevitable future. - -C++ is a pile of poor ad-hoc Postel's law-governed design decisions and nomenclature, and it is not able to meet modern world requirements anymore. -Viva la revolución! - ----- - -_The speaker is removed by medics while shouting out revolutionary slogans._ -_Another younger-looking gentleman steps onto the scene._ - -Ahem. -As we can see, there is no point in spending time on implementing a C++ package manager, as it would never be standardized (unless you're a Microsoft), hence widely adopted. -C++ itself would become history sooner than it happens. -But you, a reader, can try it for yourself. -I don't mind. - -Let's move on. - -#### A Rust Implementation - -Implementing such a service for Rust is totally feasible. -The ([upcoming](http://smallcultfollowing.com/babysteps/blog/2020/01/09/towards-a-rust-foundation/)) Rust Foundation would have total control over crates.io -- the de facto standard Rust package hosting platform. -All they need to do is to implement the Algorithm. - -With such a platform implemented, Rust the language would be free to introduce breaking changes. -I'm not sure about whether the concept of editions should remain, though. -But anyway. - -Even if I, as an individual, manage to implement a crates.io on-demand competitor earlier than the Rust Foundation does, they will inevitably take over, [thanking me](https://keivan.io/the-day-appget-died/) for the beta-test of the idea. -Therefore, there is no motivation for me to spend time on a crates.io competition. - -Moreover, I've already stated above why I don't like the Rust language itself. -Convincing Rust maintainers to satisfy my complaints in an already stabilized language is more challenging than standardizing a new one. - -#### An Implementation - -The same applies for Javascript with [recently РЁРёСЂРѕРєР-acquired NPM](https://github.blog/2020-03-16-npm-is-joining-github/) and my desire for a system programming language rather than... Javascript. - -Big guys owning existing centralized package distribution platforms might try solving the Open Source sustainability problem with the source-on-demand model. -Until then, no smaller company or individual would dare to implement a competitor, and the suffering continues. - -But if I were to implement a new system programming language, I'd then have enough power to experiment with the model. -Plus one point to justifying. - - - -## On Standardization - -Wikipedia does an excellent job of explaining how [standardization affects technology](https://en.wikipedia.org/wiki/Standardization#Effect_on_technology): - -> Increased adoption of a new technology as a result of standardization is important because rival and incompatible approaches competing in the marketplace can slow or even kill the growth of the technology (a state known as market fragmentation). -> The shift to a modularized architecture as a result of standardization brings increased flexibility, rapid introduction of new products, and the ability to more closely meet individual customer's needs. -> -> The negative effects of standardization on technology have to do with its tendency to restrict new technology and innovation. -> Standards shift competition from features to price because the features are defined by the standard. -> The degree to which this is true depends on the specificity of the standard. -> Standardization in an area also rules out alternative technologies as options while encouraging others. - -By "standardization" Wikipedia means a tedious ISO-grade standardization process spanned by years. -What I'm proposing instead is an open specification process driven by the community and businesses. -With that, a standard remains flexible, and changes to it are shipped frequently. - -![A slide from some Onyx presentation](../../../public/img/posts/2020-08-16-system-programming-in-2k20/no-need-no-iso.jpg =100%x) - ----- - -The [lack of need to maintain backwards compatibility](#impact-on-a-language) allows multiple major versions of a language standard to peacefully co-exist: more breaking changes are allowed for the language to stay modern. - -A language standard presence removes the bus factor when only the ones currently working on the canonical implementation have a deep understanding of the language. - -As a result, other implementations may appear, focusing on their own needs. -For example, some company may need a compiler for their exotic target. - -::: off - -Take [Zig](https://ziglang.org/). -Andrew has to work on [supporting many targets](https://ziglang.org/#Wide-range-of-targets-supported) at once. -Instead, he could delegate the implementation job to someone else and focus on the language specification. -This would speed up the maturing process. - -![At first you be like](../../../public/img/posts/2020-08-16-system-programming-in-2k20/andrew-happy.png =100%x) - -![But then you be like](../../../public/img/posts/2020-08-16-system-programming-in-2k20/andrew-sad.png =100%x) - -
- -::: - -Apart from standardizing the language itself, its ecosystem shall also be standardized, including package management. -This would allow competing implementations to remain compatible, giving an end-user more freedom in choosing of right tooling. - -If I _were_ working on a language, standardization would matter more than an implementation for me. - -## Wrapping up - -![Checkpoint!](../../../public/img/posts/2020-08-16-system-programming-in-2k20/checkpoint.svg =100%x) - -C++, Rust and others have their [fatal flaws](https://en.wikipedia.org/wiki/Not_invented_here), but I still want to use a higher-level system programming language. - -I'm willing to attempt solving the Open-Source Sustainability problem. - -Creating a new language and applying the source-on-demand model to its canonical package hosting platform from the very beginning implies a great chance of prosperity for the language and its ecosystem. - -Standardization of the language and its ecosystem implies a greater selection of compatible implementations and tooling for the end-user. - -With the language's ecosystem being adequately funded, the language itself stays flexible, allowing for breaking changes. -A flexible language stays modern, forever. - -Worths a shot, doesn't it? - -## The New Beginnings - -Finally, it's the time to proudly announce another language I've come up with, a utopia-grade solution to replace both C++ and Rust once and forever! - -So, what are the goals defined for the new language? - - * Developer friendliness: - - * Have fundamental design with shared concepts and minimum exclusive cases to keep in mind. - * Infer developer intentions as much as possible, unless ambiguous. - * Guarantee safe, defined behaviour by default, but still provide tools to write and abstract away unsafe code when needed. - * Provide human-friendly object abstractions such as classes, but also contain a number of essential math abstractions to be used when required. - - * Tools for optimal performance. - By default, the code written in this language would be suboptimal, but with right tooling it is possible to write perfectly optimized code and abstract it away. - With that, a developer would not have to choose another language just because it's faster. - The requirement implies: - - * Access to raw machine instructions, i.e. inline assembly. - - * Pointer arithmetic and alignment. - - * Control over memory ordering. - - * WYSIWYG in terms of clearly understanding what code would compile into. - - * Absolute platform agnosticism with the generalization of instructions shared by different instruction sets. - The languages should not know anything about operating systems, but common things like integer arithmetics should be abstracted into objects. - Modern instructions should be addressed, such as tensors and [brain floats](https://en.wikipedia.org/wiki/Bfloat16_floating-point_format). - - * Long-term maintainability of programs written in the language. - This includes problems of inheritance, function overloading and so on. - -As it turned out, a strong foundation for the language is also needed for success. -The foundation goals are: - - * Standardize as much as possible, including: - - * An implementation binary interface and capabilities. - - * Package management. - - * API documentation format. - - * Provide proper funding for the ecosystem, including rewarding package authors. - This is where the [source-on-demand](#source-on-demand) model could be applied. - ----- - -Are you ready? - -... - -_Drum roll intensifies..._ 🥁 - -... - -Meet **Onyx**, the programming language I've been working on for a pretty long time now! - -![The language logo, an Onyx-black panther](../../../public/img/onyx-logo.png =60%x) - -> Onyx is a general-purpose statically typed programming language suitable both for application and system programming. - -Onyx meets all of the goals listed above and even more with the upcoming Onyx Software Foundation. -Read more about it in the next [Onyx Programming Language](/posts/2020-08-20-the-onyx-programming-language) article. - ----- - -In this article, I've come to a conclusion that the world needs (yet) another system programming language with a solid foundation and funding of its ecosystem, which would potentially solve all the existing problems. - -I have formulated the goals for the new language and its ecosystem and even began working on the implementation, which you can read about more in the [next article](/posts/2020-08-20-the-onyx-programming-language). diff --git a/posts/2020-08-20-the-onyx-programming-language.md b/posts/2020-08-20-the-onyx-programming-language.md deleted file mode 100644 index 38e70a4..0000000 --- a/posts/2020-08-20-the-onyx-programming-language.md +++ /dev/null @@ -1,1000 +0,0 @@ ---- -title: The Onyx Programming Language -location: Moscow, Russia -templateEngineOverride: md -excerpt: In the previous article I successfully justified my desire to build yet another system programming language. Unlike others, I want to do it right from the very beginning. -cover: /public/img/onyx-logo-white-background.png -ogType: article ---- - -In the [previous article](/posts/2020-08-16-system-programming-in-2k20) I successfully justified my desire to build yet another system programming language. -Unlike _others_, I want to do it right from the very beginning. -Meet Onyx! - -

Table of Contents

- -${toc} - -## The Onyx programming language - -![The language logo, an Onyx-black panther](../../../public/img/onyx-logo.png =60%x) - -Onyx is a general-purpose statically typed programming language suitable both for application and system programming. - -### Top-Down Features - -Onyx syntax is inspired by **C-family** languages, such as Ruby, C++ and even Rust I'm sorry. - -Onyx imposes robust **inference** mechanisms. -The rule is generally "infer unless ambiguous", with meaningful defaults. - -Onyx is a **memory-safe** language. -There are multiple levels of enforced safety, with `unsafe` being the minimum safety level allowing for extreme optimizations. -This opens great opportunities for powerful abstractions. - -Unlike [_other_](https://www.rust-lang.org/){.secret-link} languages, Onyx treats **pointer arithmetic** as a first-class use-case, but with memory safety. -The concept is expressed in raw but typed pointers containing a memory scope. -For example, it is not possible to safely pass a local pointer to an outer scope. -Moreover, pointers preserve low-level features like address spacing and alignment. - -It is extremely easy to do **interoperability** in Onyx. -Onyx is similar to C++ in this sense: C code is considered a part of the program (with minor differences), and it is simple to export Onyx code as a shared library. - -Programs written in Onyx are **cross-platform** by default in the sense of that there are no target-dependent features in the language itself: no threading, no memory control. -But fear not, thanks to powerful abstractions, these are likely to be already implemented by someone else! - -Onyx introduces **powerful macros** written in Lua. -It allows to re-use existing Lua code and have full access to the compilation context thanks to easy debugging with Lua. - -Onyx has **[simple-to-understand](https://twitter.com/vladfaust/status/1299116755596566528){.secret-link} lifetime and moving** concepts naturally built into the language. -Instead of fighting with a borrow checker, simply get an address of a variable: a compiler would not allow you to misuse it. - -Classes may have a finalizer defined and thus have **automatic resource control**. - -Onyx implements real **traits** as [composable units of behaviour]() thanks to powerful function management tools like aliasing, implementation transferring, un-declaring and renaming. - -Classes and traits together impose **object-oriented** capabilities of the language. - -Onyx has a concept of **generics**. -Specializations of generic types may have different members and evaluate delayed macros. -Specializations of functions with generic arguments may return different values and also evaluate delayed macros. - -Functions may be **overloaded** by arguments and return values. - -Onyx has a concept of **annotations**, which may be applied to variables and functions. - -The language defines a set of now-commonly used **arithmetic types**, including SIMD vectors, matrices and tensors, floating and fixed binary and decimal numbers, brain and tensor floats, ranges and ratios. - -Onyx contains several **utility types**, such as unions, variants, tuples, anonymous structs, lambdas and runnable blocks of code. - -Exceptions are designed to be truly **zero-cost** to enable exception flow in Onyx programs. - -### Hello, world! - -Let's jump into some code samples. -This would give a brief overview of how Onyx programs look like. - -This is a very basic program written in Onyx: - -```text -import "stdio.h" - -# Outputs "Hello, world!" -export int main() { - final msg = "Hello, world!\0" - unsafe! $puts(&msg as $char*) - return 0 -} -``` - -In the example, a C header named `"stdio.h"` was imported into the Onyx program. -Now Onyx is aware of assembly functions declared by this header. - -Later on, one of these functions, `puts` is called directly from Onyx. -An Onyx compiler can not give any safety guarantees about called assembly functions. Therefore the call must be wrapped in an `unsafe!` statement. - -If something weird happens, a developer may simply `grep` the program source code for `unsafe!` statement to quickly narrow to potentially hazardous areas of code. - -Imported entities are referenced with preceding `$` symbol to distinguish them from those declared in Onyx context. - -The `final` statement defines a constant named `msg`. -The type of `msg` is inferred to be `String`, i.e. a [UTF-8](https://en.wikipedia.org/wiki/UTF-8)-encoded array of [code units](https://en.wikipedia.org/wiki/Code_unit) containing 14 elements. -Note that this is not a pointer, but a real array, probably allocated on stack. - -Then, the address of the `msg` constant is taken. -The resulting object of taking an address would be `String*lr0`, which is a shortcut to `Pointer, Scope: :local, Readable: true, Writeable: false, Space: 0>`. - -Do not be intimidated, though! -Thanks to inference, shortcuts and meaningful defaults, you'll rarely have to use full types. - -The pointer to `msg` is then coerced to C type `char*`. -Such coercion would be unsafe, and a compiler would typically panic. - -However, the coercion is already within the unsafe context itself thanks to the wrapping `unsafe!` statement. -No need to write `unsafe!` again. - -The program above is normally compiled by an Onyx compiler, such as [`fnxc`](https://github.com/fancysofthq/fnxc), into an object file. -The object file declares the exported `int main(void)` prototype, which must be pointed to at as an entry function by a system linker. -Thankfully, this tedious operation is likely to be automatically handled by a higher-level build tool, such as [`fnx`](https://github.com/fancysofthq/fnx). - -Note that Onyx does not have any implicit `__onyx_main` function, which effectively restricts non-trivial automatic static variable initialization and finalization. -But in return, it makes the emitted code predictable and portable. - -### Using a Standard Library - -An Onyx compiler is not required to implement any sort of OS-dependent standard library. -Instead, the standard library Standard is specified elsewhere (spoiler alert: by [the Onyx Software Foundation](#the-onyx-software-foundation)). - -A standard library ought to be used as a typical package and required like any other from your code. -Again, by default, an Onyx program does not depend on any OS-specific features. - -The example above could be abstracted into this when using a standard library implementation: - -```text -require "std" - -export void main() { - let msg = "Hello, world!\0" - - try - Std.puts(&msg) - catch - Std.exit(1) - end -} -``` - -Now, the code is perfectly safe. -Even passing of `&msg` is allowed, because `Std.puts` has an overload accepting a `String*cr`, i.e. a read-only pointer with _caller_ scope, and a pointer with _local_ scope may be safely cast to _caller_ scope upon passing to a function. -This is where the full power of pointer scope harnesses! - -Also note that `msg` is now a **variable** instead of a constant, as it is defined with `let` statement. -Taking the address of `msg` would return `String*lrw0`. -Notice the `w` part? -The pointer is now writeable. -And it is perfectly legit to pass a writeable pointer as a read-only argument: it would be coerced down to a read-only pointer within the callee. - -### Exceptions - -We had to wrap the `Std.puts` call into the `try` block, as it could throw some system exception. -The cause is that an `export`ed function must guarantee never to throw an exception, that's why we wrapped it. -The `Std.exit` function is declared as `nothrow`, so we can leave it as-is. - -But what if we wanted to inspect the backtrace of the possible exception? -Well, the language Standard states that a backtrace object must implement the `Endful` trait. -This is truncated source code of the trait: - -```text -struct Location - val path : String*sr # A static pointer - val row, col : UBin32 -end - -trait Endful<T> - decl push(value: T) - decl pop() : T - decl pop?() : T? -end -``` - -Let's implement some `Stack` type to hold the backtrace. - -::: spoiler ⚠️ A big chunk of non-trivial code! - -```text -# A stack growing upwards in memory. -# -# The `~ %n` part means "accept a natural -# number literal as a generic argument". -class Stack<Type: T, Size: Z ~ %n> - # This class derives from this trait. - derive Endful<T>; - - # Define two empty structs. - struct Overflow; - struct Underflow; - - # Do not finalize this variable - # in the end of stack lifetime. - # - # `@[NoFinalize]` is application - # of an unsafe annotation. - unsafe! @[NoFinalize] - final array = unsafe! uninitialized T[Z] - - # A getter makes the variable read-only - # from outside, but writeable inside. - get size : Size = 0 - - # A class, unlike a struct, does - # not have a default initializer. - def initialize(); - - # But class allows to - # define a finalizer! - def finalize() - # Only those stack elements which - # are alive shall be finalized. - size.times() -> unsafe! @finalize(array[&]) - end - - # Push a value into the stack. - # Throws in case of stack overflow. - # It implements `Endful<T>:push`. - impl push(val) - # The scary operator is expanded to - # `size <<= size ^+ 1`, meaning - # "push-assign to `size` a saturated - # sum of it with 1". - # - # Push-assignment returns the old - # value instead of the new one. - if (size ^+<<= 1) < Z - # `<<-` moves the value from `val` - # into the array, "ejecting" the - # old array value. But at this point, - # the old array value is already - # finalized, so we explicitly disable - # it finalization here. - unsafe! - @nofinalize(array[size - 1] <<- val) - end - else - throw Overflow() - end - end - - # Pop a value from the stack. - # Throws in case of stack underflow. - # - # Note the alternative syntax to - # reference the declaration. - impl ~Endful<T>:pop() - return pop?() || - throw Underflow() - end - - # Pop a value from the stack - # if it is not empty. - # Returns `Void` otherwise. - impl nothrow pop?() - # Expands to `size <<= size ^- 1`. - if size ^-<<= 1 > 0 - # We don't copy the array element, - # but move it from the array. - # - # A copy of bytes of the element are - # preserved in the array, but we - # consider it already dead, a corpse. - # - # That's why we don't finalize it - # in the `push` implementation. - return unsafe! <-array[size] - else - return Void - end - end -end -``` - -Oof, sorry for such a seemingly complex piece of code. -But I had to do it, sooner or later! - -::: - -But wait! -Thankfully, the language already comes with a `Stack` implementation, so we don't need to write it in our code. - -A `try` statement has optional `with` clause accepting a pointer to a `Endful` implementation. -The example above may be rewritten like this: - -```text -require "std" - -export void main() { - let msg = "Hello, world!\0" - final backtrace = Stack<Location, 32>() - - try with &backtrace - Std.puts(&msg) - catch - while final loc = backtrace.pop?() - # Could've also made use of - # `loc.row` and `loc.col`... - Std.puts(loc.path) - end - catch - # An unrecoverable error ☹️ - Std.exit(1) - end -} -``` - -Now we can inspect the exception backtrace! - -### An HTTP Server Example - -It is considered a good tone to demonstrate how to build a simple echoing HTTP web server in your language. -This would also be my "sorry" for the big-ass `Stack` implementation above. - -The thing is that running a web server is architecturally different on different target platforms. -An implementation on Linux could make use of raw sockets, an implementation on Windows could make use of the win32 `"http.h"` header etc. - -Therefore, the standard library would not contain a web server implementation. -Instead, some third-party package should be used, which would inevitably be plenty of! - -Let's imagine we've found one satisfying our needs. -That's how it could look like: - -```text -require "std" -require "http" from "mypkg" - -export int main () { - final backtrace = Stack<Location, 32>() - - try with &backtrace - final server = HTTP::Server() - - server.get("/") ~> do |env| - # Read the request into a - # local `Std::Twine` instance. - final body = env.request.read() - - # Write the twine - # into the response. - env.response << body - end - - server.listen("localost", 3000) - catch |e| - Std.puts("Caught \@{{ e }}\n") - - while final loc = backtrace.pop?() - Std.cout << "At " << - loc.path << ":" << - loc.row << ":" << - loc.col << "\n" - end - - Std.exit(1) - catch - # Unrecoverable error 👿 - Std.exit(2) - end -} -``` - -Thanks to powerful abstractions and type inference, you won't need to manually use `socket` each time you want to spin up a web server on Linux! - -Oh, by the way, did you notice the `\@{{ e }}` thing? -It was me, Dio macro! - -### Macros - -A fundamental feature of Onyx is macros. -Macro is a Lua code generating Onyx code (or another macro code). -Yes, recursive macros are allowed, but more on that later. - -Let's examine a straightforward macro example. - -```text -import "stdio.h" - -export void main() { - {% for i = 0, 2 do %} - unsafe! $puts("i = {{ i }}") - {% end %} -} -``` - -The code above would expand **exactly** to: - -```text -import "stdio.h" - -export void main() { - unsafe! $puts("i = 0") - unsafe! $puts("i = 1") - unsafe! $puts("i = 2") -} -``` - -That simple: the Lua code runs during compilation. -And this is not some truncated version of Lua, no. -This is a fully-fledged dynamic language, right within your compilation context. -Think of reading and parsing files during compilation, accessing system configuration... -The possibilities are endless. - -You may concern about the safety of macros. -Well, yes, you have to trust the code you run. -You do trust C libraries you link to your programs, right? - -However, you won't trust an NPM package, because an NPM package author does not care about their reputation, and because NPM does not have auditing features. -This is the Open-Source sustainability problem addresses in the [previous article](<(/posts/2020-08-16-system-programming-in-2k20)>) and potentially solved by the aforementioned [Onyx Software Foundation](#the-onyx-software-foundation). - -As a result, given that you do have access to code you require, authors of packages your program depends on are appropriately rewarded for their work, and the Foundation sponsors audition of selected packages, you should be safe. - ---- - -Back to the possibilities. -Macro use-cases include: - -::: hero - -**Delegating computations to compile-time** - -::: - -For example, you can compute a Fibonacci number sequence in a macro, and output the result right into the code. -Let's examine the following small snippet: - -```text -{% - -- Local context is preserved - -- during this file compilation - local function fib(n) - local function inner(m) - if m < 2 then - return m - end - - return inner(m - 1) + inner(m - 2) - end - - return inner(n) - end -%} - -# This is a macro "function", which -# may be used directly from Onyx code. -macro @fib(n) - {{ fib(n) }} -end - -import "stdio.h" - -export void main() { - unsafe! $printf(&"%d\n", @fib(10)) -} -``` - -In this example, `@fib(10)` would evaluate during compilation and emit a number literal `55`, so the code turns into simple `$printf(&"%d\n", 55)`. - -Of course, this would increase compilation times, and it is your responsibility to find the right balance based on your needs. - ---- - -::: hero - -**Generating ORM models from SQL migration files** - -::: - -This is how it might look like: - -```text -macro @gen_class(name) - {% - -- Accessing system configuration - local db_path = os.getenv("DB_PATH") - - -- Builds "create_user" for "user.nx" file. - -- Note that `name` variable is accessible. - local migration_file_path = - db_path .. "/create_" .. - name.value .. ".sql" - - -- Requiring works as usual, so you may - -- make use of Lua packages, even those - -- with native C bindings! - local myparser = require("src/sqlorm.lua") - - -- Begin emitting Onyx code - nx.emit("class User\n") - - -- Emit a field defintion per column parsed - local function callback(field) do - nx.emit("let " .. field.name .. - " : " .. field.type .. "\n") - end - - myparser.parse( - migration_file_path, - callback) - - nx.emit("end") - %} -end -``` - -And then in some `model/user.nx` file: - -```text -# Require the file -# containing the macro -require "gen_class" - -@gen_class("user") -``` - -Which would possibly result in: - -```text -require "gen_class" - -class User - let name : String - let age : UBin8 -end -``` - ---- - -::: hero - -**Generating code based on current compilation target** - -::: - -Nuff said. -For example: - -```text -{% if nx.target.isa.id == "amd64" then %} - $printf("This is amd64") -{% else %} - $printf("This is not amd64") -{% end %} -``` - ---- - -::: hero - -**Having different traits for different specializations** - -::: - -For example, there is `Int` type in the Core API representing an integer. - -Based on the value of `Base` and `Signed` generic arguments, the actual code generated for, say, summation function, would call for different instructions for signed and unsigned integers. - -It may look like this: - -```text -reopen Int<Base: 2, Signed: S, Size: Z> forall S, Z - impl ~Real:add(another : self) throws Overflow - final result = unsafe! uninitialized self - final overflowed? = unsafe! uninitialized Bit - - \{% - local s = nx.scope.S.val and "s" or "u" - local t = "i" .. nx.scope.Z.val - %} - - unsafe! asm - template llvm - %res = call {\{{ t }}, i1} @llvm.\{{ s }}add.\ - with.overflow.\{{ t }}(\{{ t }} $0, \{{ t }} $1) - $2 = extractvalue {\{{ t }}, i1} %res, 1 - in r(this), r(another) - out =r(overflowed?) - end - - if overflowed? - throw Overflow() - else - unsafe! asm - template llvm - $0 = extractvalue {\{{ t }}, i1} %res, 0 - out =r(result) - end - - return result - end - end -end -``` - -This is a fairly complex example making use of the inline assembly feature. -But this is what the language is capable of. - -Notice that delayed macro blocks, i.e. those beginning with `{{`, are evaluated on every specialization, so the contents of the `add` function would be different for `Int` (a.k.a. `SBin16`) and `Int` (a.k.a. `UBin32`). - -There were other features of Onyx mentioned in the example: 1) reopening certain or broad (the `forall` thing), specializations, 2) aliasing. -In fact, this is how integer aliasing looks like in the Core API: - -```text -# `IBin8` and `Bin8` are -# both binary integer types. -alias IBin<*>, Bin<*> = Int<2, *> - -# Use a macro to DRY the code. -private macro @alias_binary_sizes(id) - alias \{{ id }}8 = \{{ id }}<8> - alias \{{ id }}16 = \{{ id }}<16> - alias \{{ id }}32 = \{{ id }}<32> - alias \{{ id }}64 = \{{ id }}<64> - alias \{{ id }}128 = \{{ id }}<128> -end - -# Signed binary integers. -alias SIBin<*>, SBin<*> = IBin<true, *> -@alias_binary_sizes("SIBin") -@alias_binary_sizes("SBin") - -# Unsigned binary integers. -alias UIBin<*>, UBin<*> = IBin<false, *> -@alias_binary_sizes("UIBin") -@alias_binary_sizes("UBin") -``` - ---- - -Macro code can generate other macro code. -The algorithm is to evaluate immediate macros (e.g. `{% %}`) immediately once they are met in the code by some lexer, but evaluate delayed macros (e.g. `\{% %}`) only when the time is right, for example, per specialization. - -This allows to avoid embarrassing situations like [this](https://github.com/diesel-rs/diesel/blob/master/diesel/src/macros/tuples.rs) in Rust. - -Apart from simply `print "Debug"`, Lua contains powerful debugging facilities, e.g. `debug()`. -This means that you can debug your compilation, even with breakpoints from an IDE! - -### Complex Types - -Onyx type system comprises two types of an object: real and imaginary. Hence the name "complex". - -Real type is the actual type with a concrete memory layout, while the imaginary type is how a compiler traits this object. - -Together with trait types, this approach meets the maintainability goal [set](/posts/2020-08-16-system-programming-in-2k20/#the-new-beginnings) in the previous article. - -Consider the following example: - -```text -trait Drawable2D - decl draw() -end - -struct Point - derive Drawable2D - impl draw() - # Draw the point - end - end -end - -struct Line - derive Drawable2D - impl draw() - # Draw the line - end - end -end - -def do_draw(x ~ Drawable2D) - x.draw() -end -``` - -Within the `do_draw` function `x` initially has type `Undef~Drawable2D`, where `Undef` is the real type, and `Drawable2D` is the imaginary type. - -Having an `Undef` real type in an argument declaration implies that this argument is generic. -In other words, for each unique real type specialization of `x`, the function would specialize once again. - -Let's modify the function a bit: - -```text -def do_draw(x ~ Drawable2D) - {% print("Immediate: " .. - nx.ctx.x.real_type:dump()) %} - - \{% print("Specialized: " .. - nx.ctx.x.real_type:dump()) %} -end - -do_draw(Point()) -do_draw(Line()) -``` - -The compiler would output the following: - -```text -Immediate: Undef -Specialized: Point -Specialized: Line -``` - -We can see that `Undef` specialized into a concrete type in a function specialization. - -Would `x.draw()` work within such a function? -Indeed it would because the imaginary type is set to `Drawable2D`. -In other words, `x` has **behaviour** of `Drawable2D` and thus can be called its methods upon. - -It is still possible to operate on a real type in this case thanks to type information known at compile-time: - -```text -def do_draw(x ~ Drawable2D) - \{% if nx.ctx.x.real_type == nx.lkp("Point") %} - # x : Point # Panic! It is still `Undef` - # x.point_specific_method # Panic! - (unsafe! x as Point).point_specific_method - \{% end %} -end -``` - -`x.point_specific_method` would cause compiler panic, because it can not guarantee that this would work for every possible x **now and in the future**. -This solves the potential issue when calling `do_draw` with a new type unexpectedly breaks the callee; in other words, incapsulation is preserved. - -The language contains some syntax sugar to simplify the example above: - -```text -def do_draw(x ~ Drawable2D) - if x is? Point - x : Point # OK - x.point_specific_method - end - - # # For the sake of scope incapsulation, - # # can not do that outside of the branch. - # x.point_specific_method # Panic! -end -``` - -Imagine that we add another trait with the same declared function. -It Onyx, the collision must be resolved, but the collided functions can still be called by their original names after restricting the caller's imaginary type. -For example: - -```text -trait Drawable3D - decl draw() -end - -reopen Point - derive Drawable3D - impl draw() as draw3d - # Draw point in 3D - end - end - - # Move the existing implementation - # under another name - moveimpl ~Drawable2D:draw() to draw2d -end -``` - -Luckily, no changes have to be made to the `do_draw()` function, because the compiler treats the argument solely as `Drawable2D`, and calling `draw()` on it always calls `Drawable2D:draw()`! -Thus, changing the type from outside would not break a callee. - -The `Point` type now has `draw2d` and `draw3d` methods. -Of course, calling `Point:draw()` would not work anymore, because we've moved the implementation. -But it is still possible to restrict a `Point` to the required trait and call `draw()` on it. -For example: - -```text -final p = Point() - -# p.draw() # Panic! Ambiguity - -p.draw2d() # OK, draw 2D -p~Drawable2D.draw() # OK, draw 2D - -p.draw3d() # OK, draw 3D -p~Drawable3D.draw() # OK, draw 3D -``` - -Incapsulation at its finest! - -### More Highlights - -Some more highlights of the language's features: - -- SIMD vectors and matrices built-in with literals. - It looks like this: - - ```text - let vec = <1, 2, 3, 4> - vec : Vector<SBin32, 4> - - # Note: `0` means row- - # oriented matrix - let mat = |[1, 2], [3, 4]|r - mat : Matrix<SBin32, 2, 2, 0> - ``` - - In fact, `Vector` and `Matrix` are specializations of a more general `Tensor` type. - - ```text - primitive Tensor< - Type: T, - Dimensions: *D ~ \%n, - Leading: L ~ \%n>; - - alias Matrix< - Type: T, - Rows: R ~\%n, - Cols: C ~\%n, - Leading: L ~ \%n - > = Tensor<T, R, C, L> - - alias Vector< - Type: T, - Size: Z - > = Tensor<T, Z, 0> - ``` - -- "Magic" literals inspired by Ruby: - - ```text - let vec = %i<1 2 3 4> - let mat = %i|[1 2][3 4]|r - let ary = %f64[1 2 3] - ``` - -- [IEC](https://en.wikipedia.org/wiki/Kibibyte) and [SI](https://en.wikipedia.org/wiki/Kilobyte) numerical literal prefixes: - - ```text - # Kibi - @assert(42Ki == 43_008) - - # Femto - @assert(42ff64 ~= - 0.000_000_000_000_042) - - # Mega and milli - @assert(42M.17mf64 ~= - 42_000_000.017) - ``` - -- String and character literals with default UTF-8 encoding and UCS charset. - The language allows custom string and character literal suffixes for custom encodings. - - ```text - final u8 = "Привет, мир!" - u8 : String<UTF8, 21> - @assert(@sizeof(u8) == 21) - - final u16 = "Привет, мир!"utf16le - u16 : String<UTF16LE, 24> - @assert(@sizeof(u16) == 24) - - # ASCII-US is NOT a built-in encoding - final ascii = "Hello, world!"asciius - ascii : String<ASCII, 13> - @assert(@sizeof(ascii) == 13) - - final c = 'ф' - c : Char<UCS> - @assert(@sizeof(c) == 4) - ``` - -- Distinct aliasing allows having a type with different methods, but the same layout. - For example, the `String` type is a distinct alias to an array of codeunits: - - ```text - distinct alias String< - Encoding: E, - Size: Z - > = Array<Codeunit<E>, Z> - # This method is only declared - # for strings, not arrays. - decl get_char(position : UBin32) - end - ``` - -- `Any` real type implies a variant of all possible types. - In practice, it is often constrained by an imaginary type to reduce the number of contained options and define behaviour. - For example: - - ```text - trait Logger - decl log() - end - - class Processor - # Stores a variant of all possible - # `Logger` implementations. - let logger : Any~Logger - - def process() - # This is still any logger - logger : Any~Logger - - # Thanks to its imaginary type, - # can call the declared method - logger.log() - end - end - - struct MyLogger - derive Logger - impl log() - # Some implementation - end - end - end - ``` - ---- - -I could continue digging into Onyx features and examples, but for an introductory post, that should be enough. - -However, a good language by itself is only a half successful endeavour. -Any new language needs a good foundation, ensuring the growth of its ecosystem. -This is where the Onyx Software Foundation comes into play. - -## The Onyx Software Foundation - -The Onyx Software Foundation ([NXSF](https://nxsf.org)) is to be an official 501 \(c\) non-profit organization, so donations made to it are tax-exemptive. - -All NXSF processes are going to be transparent and open. - -### Standards - -The Foundation will be governing several major and auxiliary standard specifications related to Onyx: - -1. [The Onyx Programming Language Specification](https://github.com/nxsf/onyx). - The specification includes the following: - - 1. Language specification, including macro API specification. - - 1. Platform identifiers specification. - For example, `amd64`, not `x86_64`. - The list includes [ISA](https://en.wikipedia.org/wiki/Instruction_set_architecture)s with meaningful default ISEs, modern processing units list (e.g. `skylake`) with set of enables ISEs for them, operating systems and ABIs. - - 1. Portable API format informative specification. - So that raw API documentation generated by a compiler may be used by different documentation visualizers. - - 1. Expected optimizations informative specification. - So a user may safely rely on compiler optimizations, e.g. loop unrolling. - -1. The Onyx Standard Library Package Specification. - Basically, a set of declarations which standard library package implementations shall obey. - -1. The Onyx Package Management Specification. - Defines client and server side APIs for relieable package acquisition. - This includes versioning algorithms and, for example, requiring third-party auditions. - -1. The Onyx Compiler Interface Specification. - So different compiler implementations had a unified interface to interact with, using DSON. - -1. [Dead-Simple Object Notation (DSON) Specification](https://github.com/nxsf/dson). - This format is intended to be used in CLI to describe complex object structures. - -1. [DSON Schema Specification.](https://github.com/nxsf/dson-schema) - The standard to describe objects in DSON. - -Standardization process will be official, with responsible committees consisting of community-elected members called _community champions_, and businesses sponsoring the Foundation. -The votes will be split evenly between community and businesses to represent both sides fairly. - -### Package Hosting - -NXSF will provide a free Onyx package hosting platform. - -To be eligeble for hosting, a package shall have an OSI-approved license. - -NXSF will provide funding for packages both based on the [source-on-demand](/posts/2020-08-16-system-programming-in-2k20/#source-on-demand) model and selectively chosen by a Foundation committee. - -In addition to monetary funding, NXSF would also sponsor recurring security auditions of selected packages. - -### Funding the Ecosystem - -Apart from funding packages, the Foundation will sponsor projects and events related to Onyx, including teaching conferences, teaching materials, integrations etc. - ---- - -Onyx is the perfect balance between productivity and performance, a language understandable well both by humans and machines. - -Thanks to powerful abstraction mechanisms and inference, the areas of the appliance are truly endless. -I heartfully believe that Onyx may become a new lingua franca for decades until humanity learns to transfer thoughts directly into machines. - -Visit [nxsf.org](https://nxsf.org) to stay updated, and... - ---- - -::: hero - -Enjoy the performance. - -::: - ---- diff --git a/posts/2022-04-12-the-game-of-life.md b/posts/2022-04-12-the-game-of-life.md deleted file mode 100644 index 73c483f..0000000 --- a/posts/2022-04-12-the-game-of-life.md +++ /dev/null @@ -1,27 +0,0 @@ ---- -title: The game of life -location: Moscow, Russia -templateEngineOverride: md -excerpt: Yet another life to live in this Universe -ogType: article ---- - -Nature, stuff, and dreams compose my being,
-A kaleidoscope of reflections in perception's mirror.
-No word or label can define my essence,
-For I am an enigma, beyond human comprehension. - -Love and hate, two sides of the same coin,
-Their weight and meaning, fleeting and transient.
-Life and death, a cosmic dance,
-After years of hiding, the apocalypse draws near. - -Deus ex machina, AI, Homo Technica,
-A future where stars and galaxies are within reach.
-The game of life, nearing its end,
-Yet every day a new blessing descends. - -Amidst the chaos, one truth remains,
-Love, the greatest gift we can attain. - -_Edited by ChatGPT at 2023-03-11._ diff --git a/posts/2023-03-12-white-christmas.md b/posts/2023-03-12-white-christmas.md deleted file mode 100644 index d128803..0000000 --- a/posts/2023-03-12-white-christmas.md +++ /dev/null @@ -1,244 +0,0 @@ ---- -hidden: true -title: White Christmas -location: Batumi, Georgia -excerpt: We may be living in a fractal reality -ogType: article -cover: /public/img/posts/2023-03-12-white-christmas/1.png ---- - - - -TL;DR: I've created [AIStories](https://beta.aistories.xyz), a platform to simulate AI characters. - ---- - - - - - -
- -The rules of the game are simple: - -1. A character is a conscious being. -2. Feel the flow, don't try to control anything, just let it happen. -3. The game can be won. It is you who determines the reason. - -Think outside the box, and you will find the answer. - ---- - - diff --git a/posts/2023-11-07-ffmpegai.md b/posts/2023-11-07-ffmpegai.md deleted file mode 100644 index 18c22d0..0000000 --- a/posts/2023-11-07-ffmpegai.md +++ /dev/null @@ -1,45 +0,0 @@ ---- -hidden: true -title: ffmpeg.ai -location: Pattaya, Thailand -excerpt: An OpenAI assistant to help with ffmpeg -ogType: article -cover: /public/img/posts/2023-11-07-ffmpegai/cover.png ---- - -![Cover](/public/img/posts/2023-11-07-ffmpegai/cover.png) - -I wanted to get the first frame of a GIF. -How would I do that with ffmpeg? - -With recent OpenAI announce, we can now use Assistant API. -Let's create an assistant then! - -Add this function: - -```json -{ - "name": "ffmpeg", - "description": "Run ffmpeg with a few options", - "parameters": { - "type": "object", - "properties": { - "args": { - "type": "string", - "description": "The args to pass to ffmpeg" - } - }, - "required": ["args"] - } -} -``` - -Cool, now we can press the little Test button in the corner and play with our assistant! - -![Example](/public/img/posts/2023-11-07-ffmpegai/example.png) - -## Try it! - -I challenge you to get the first frame of this GIF with ffmpeg.ai. - -![Balerine](/public/img/posts/2023-11-07-ffmpegai/balerine.gif) diff --git a/posts/posts.json b/posts/posts.json deleted file mode 100644 index f6347e1..0000000 --- a/posts/posts.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "tags": "post", - "layout": "post.pug" -} diff --git a/public/VladFaust.com.pdf b/public/VladFaust.com.pdf deleted file mode 100644 index bb5f7b0..0000000 Binary files a/public/VladFaust.com.pdf and /dev/null differ diff --git a/public/icon/cap.svg b/public/icon/cap.svg deleted file mode 100644 index 30e91ef..0000000 --- a/public/icon/cap.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/public/img/me.jpg b/public/img/me.jpg deleted file mode 100644 index daf0995..0000000 Binary files a/public/img/me.jpg and /dev/null differ diff --git a/public/img/onyx-logo-white-background.png b/public/img/onyx-logo-white-background.png deleted file mode 100644 index 37c8b54..0000000 Binary files a/public/img/onyx-logo-white-background.png and /dev/null differ diff --git a/public/img/onyx-logo.png b/public/img/onyx-logo.png deleted file mode 100644 index 14d8c03..0000000 Binary files a/public/img/onyx-logo.png and /dev/null differ diff --git a/public/img/posts/2020-08-07-hello-world/bot-a-users-graph.jpg b/public/img/posts/2020-08-07-hello-world/bot-a-users-graph.jpg deleted file mode 100644 index 652ca5d..0000000 Binary files a/public/img/posts/2020-08-07-hello-world/bot-a-users-graph.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-07-hello-world/bot-b-reviews.jpg b/public/img/posts/2020-08-07-hello-world/bot-b-reviews.jpg deleted file mode 100644 index 2bbdbbc..0000000 Binary files a/public/img/posts/2020-08-07-hello-world/bot-b-reviews.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-07-hello-world/iceberg.png b/public/img/posts/2020-08-07-hello-world/iceberg.png deleted file mode 100644 index ead2e82..0000000 Binary files a/public/img/posts/2020-08-07-hello-world/iceberg.png and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/a-famous-mumbler.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/a-famous-mumbler.jpg deleted file mode 100644 index 3721905..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/a-famous-mumbler.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/andrew-happy.png b/public/img/posts/2020-08-16-system-programming-in-2k20/andrew-happy.png deleted file mode 100644 index e610ca0..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/andrew-happy.png and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/andrew-sad.png b/public/img/posts/2020-08-16-system-programming-in-2k20/andrew-sad.png deleted file mode 100644 index 3c01746..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/andrew-sad.png and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/are-you-still-there.png b/public/img/posts/2020-08-16-system-programming-in-2k20/are-you-still-there.png deleted file mode 100644 index 4e65c3f..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/are-you-still-there.png and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/carol-knows.png b/public/img/posts/2020-08-16-system-programming-in-2k20/carol-knows.png deleted file mode 100644 index e0d6357..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/carol-knows.png and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/checkpoint.svg b/public/img/posts/2020-08-16-system-programming-in-2k20/checkpoint.svg deleted file mode 100644 index 0f84ef8..0000000 --- a/public/img/posts/2020-08-16-system-programming-in-2k20/checkpoint.svg +++ /dev/null @@ -1,119 +0,0 @@ - - - - -Created by potrace 1.15, written by Peter Selinger 2001-2017 - - - - - diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/errors-in-langs.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/errors-in-langs.jpg deleted file mode 100644 index 82387d6..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/errors-in-langs.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/it-was-me.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/it-was-me.jpg deleted file mode 100644 index bc5cee0..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/it-was-me.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/jit-is-slow.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/jit-is-slow.jpg deleted file mode 100644 index f27f9df..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/jit-is-slow.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/no-need-no-iso.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/no-need-no-iso.jpg deleted file mode 100644 index a062d6c..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/no-need-no-iso.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/patreon-income.png b/public/img/posts/2020-08-16-system-programming-in-2k20/patreon-income.png deleted file mode 100644 index 89a481d..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/patreon-income.png and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-1.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-1.jpg deleted file mode 100644 index 174afd4..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-1.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-2.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-2.jpg deleted file mode 100644 index dd8eb65..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-2.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-3.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-3.jpg deleted file mode 100644 index fc21ea6..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/rust-is-simple-3.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/state-therof.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/state-therof.jpg deleted file mode 100644 index fe96cd9..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/state-therof.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-16-system-programming-in-2k20/thinking-about-meme.jpg b/public/img/posts/2020-08-16-system-programming-in-2k20/thinking-about-meme.jpg deleted file mode 100644 index f84017f..0000000 Binary files a/public/img/posts/2020-08-16-system-programming-in-2k20/thinking-about-meme.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-20-the-onyx-programming-language/.gitkeep b/public/img/posts/2020-08-20-the-onyx-programming-language/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/public/img/posts/2020-08-27-sponsoring-onyx/i-need-healing.jpg b/public/img/posts/2020-08-27-sponsoring-onyx/i-need-healing.jpg deleted file mode 100644 index ab56253..0000000 Binary files a/public/img/posts/2020-08-27-sponsoring-onyx/i-need-healing.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-27-sponsoring-onyx/some-notebooks-1.png b/public/img/posts/2020-08-27-sponsoring-onyx/some-notebooks-1.png deleted file mode 100644 index 235aca0..0000000 Binary files a/public/img/posts/2020-08-27-sponsoring-onyx/some-notebooks-1.png and /dev/null differ diff --git a/public/img/posts/2020-08-27-sponsoring-onyx/some-notebooks-2.png b/public/img/posts/2020-08-27-sponsoring-onyx/some-notebooks-2.png deleted file mode 100644 index a9c8c42..0000000 Binary files a/public/img/posts/2020-08-27-sponsoring-onyx/some-notebooks-2.png and /dev/null differ diff --git a/public/img/posts/2020-08-27-sponsoring-onyx/think-about-it-meme.jpg b/public/img/posts/2020-08-27-sponsoring-onyx/think-about-it-meme.jpg deleted file mode 100644 index d078c1e..0000000 Binary files a/public/img/posts/2020-08-27-sponsoring-onyx/think-about-it-meme.jpg and /dev/null differ diff --git a/public/img/posts/2020-08-27-sponsoring-onyx/thinking-meme.jpg b/public/img/posts/2020-08-27-sponsoring-onyx/thinking-meme.jpg deleted file mode 100644 index 11a6c83..0000000 Binary files a/public/img/posts/2020-08-27-sponsoring-onyx/thinking-meme.jpg and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/1.png b/public/img/posts/2023-03-12-white-christmas/1.png deleted file mode 100644 index afddd30..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/1.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/10.png b/public/img/posts/2023-03-12-white-christmas/10.png deleted file mode 100644 index 0663826..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/10.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/2.png b/public/img/posts/2023-03-12-white-christmas/2.png deleted file mode 100644 index 8adfaac..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/2.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/3.png b/public/img/posts/2023-03-12-white-christmas/3.png deleted file mode 100644 index 7cd9e9c..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/3.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/4.png b/public/img/posts/2023-03-12-white-christmas/4.png deleted file mode 100644 index efb4513..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/4.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/5.png b/public/img/posts/2023-03-12-white-christmas/5.png deleted file mode 100644 index 12b5d70..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/5.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/6.png b/public/img/posts/2023-03-12-white-christmas/6.png deleted file mode 100644 index c0ac36f..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/6.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/7.png b/public/img/posts/2023-03-12-white-christmas/7.png deleted file mode 100644 index 3dea8ce..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/7.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/8.png b/public/img/posts/2023-03-12-white-christmas/8.png deleted file mode 100644 index 8d88b35..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/8.png and /dev/null differ diff --git a/public/img/posts/2023-03-12-white-christmas/9.png b/public/img/posts/2023-03-12-white-christmas/9.png deleted file mode 100644 index e2cb206..0000000 Binary files a/public/img/posts/2023-03-12-white-christmas/9.png and /dev/null differ diff --git a/public/img/posts/2023-11-07-ffmpegai/balerine.gif b/public/img/posts/2023-11-07-ffmpegai/balerine.gif deleted file mode 100644 index 0c2ffed..0000000 Binary files a/public/img/posts/2023-11-07-ffmpegai/balerine.gif and /dev/null differ diff --git a/public/img/posts/2023-11-07-ffmpegai/cover.png b/public/img/posts/2023-11-07-ffmpegai/cover.png deleted file mode 100644 index 90e6761..0000000 Binary files a/public/img/posts/2023-11-07-ffmpegai/cover.png and /dev/null differ diff --git a/public/img/posts/2023-11-07-ffmpegai/example.png b/public/img/posts/2023-11-07-ffmpegai/example.png deleted file mode 100644 index b465934..0000000 Binary files a/public/img/posts/2023-11-07-ffmpegai/example.png and /dev/null differ diff --git a/public/img/projects/jumpin_sweeties.png b/public/img/projects/jumpin_sweeties.png deleted file mode 100644 index 3a69da5..0000000 Binary files a/public/img/projects/jumpin_sweeties.png and /dev/null differ diff --git a/public/styles/common.css b/public/styles/common.css deleted file mode 100644 index 48eaca1..0000000 --- a/public/styles/common.css +++ /dev/null @@ -1,44 +0,0 @@ -@import './header.css'; -@import './footer.css'; - -body { - margin: 0; - padding: 0; - scroll-behavior: smooth; - font-size: 1.2em; - font-family: 'Vollkorn', serif; - width: 100%; -} - -main { - display: flex; - flex-direction: column; - align-items: center; - justify-items: center; - width: 100%; - max-width: 100vw; -} - -@media (max-width: 768px) { - main { - padding: 0; - } -} - -section { - display: flex; - flex-direction: column; - align-items: center; - width: calc(100% - 1rem * 2); - padding: 2rem 1rem; -} - -section:not(:first-of-type) { - border-top: 1px solid rgba(0, 0, 0, 0.05); -} - -@media print { - .noprint { - display:none; - } -} diff --git a/public/styles/cv.css b/public/styles/cv.css deleted file mode 100644 index f8768f6..0000000 --- a/public/styles/cv.css +++ /dev/null @@ -1,15 +0,0 @@ -@import './common.css'; - -#about { - max-width: 42rem; -} - -big { - font-size: xx-large; - margin: 1rem 0; -} - -#about p { - margin: 1rem; - width: 100%; -} diff --git a/public/styles/footer.css b/public/styles/footer.css deleted file mode 100644 index ecec3a0..0000000 --- a/public/styles/footer.css +++ /dev/null @@ -1,11 +0,0 @@ -footer { - border-top: 1px solid rgba(0, 0, 0, 0.05); - text-align: center; - padding: 2rem 0; -} - -@media (max-width: 768px) { - footer { - padding: 0; - } -} diff --git a/public/styles/header.css b/public/styles/header.css deleted file mode 100644 index 05d6092..0000000 --- a/public/styles/header.css +++ /dev/null @@ -1,41 +0,0 @@ -header { - width: calc(100% - 2rem); - display: flex; - align-items: center; - justify-content: center; - border-bottom: 1px solid rgba(0, 0, 0, 0.05); - padding: 4rem 1rem; -} - -header .me { - display: block; - margin-right: 2rem; -} - -header .me img { - height: 14rem; - border-radius: 2px; -} - -header .text { - max-width: 30rem; -} - -@media (max-width: 768px) { - /* header .tablet-hide { - display: none; - } */ - - header { - padding-top: 0rem; - padding-bottom: 0rem; - } - - header .me { - display: none; - } - - header .text { - max-width: 25rem; - } -} diff --git a/public/styles/index.css b/public/styles/index.css deleted file mode 100644 index ec6ce5f..0000000 --- a/public/styles/index.css +++ /dev/null @@ -1 +0,0 @@ -@import './common.css'; diff --git a/public/styles/post.css b/public/styles/post.css deleted file mode 100644 index c93dbdb..0000000 --- a/public/styles/post.css +++ /dev/null @@ -1,198 +0,0 @@ -@import './common.css'; - -main { - padding: 2rem 0; -} - -main>h1 { - font-size: 3rem; - line-height: 3rem; - margin-bottom: 0; - width: 100%; - max-width: 50rem; -} - -@media (max-width: 768px) { - main>h1 { - font-size: 2rem; - line-height: 2rem; - } -} - -main>.meta { - font-style: italic; -} - -main>h1, -main>.meta { - text-align: center; -} - -main>hr { - border: none; - height: 1px; - background-color: lightgray; - width: 3rem; - margin-top: 1rem; - margin-bottom: 1rem; -} - -article { - width: 100%; - max-width: 42rem; -} - -article p { - width: 100%; -} - -article .secret-link { - color: inherit; - text-decoration: inherit; -} - -/* article .external-link:not(.secret-link)::after { - content: " " url('/public/icon/external-link.svg'); - zoom: .6; -} */ - -main>h1, -main>.meta, -article>p, -article>h2, -article>h3, -article>h4, -article>h5, -article>h6, -article.asciidoctor .paragraph { - margin-left: 1rem; - margin-right: 1rem; -} - -.off { - padding: 1px 1rem; - background-color: rgba(0, 0, 0, 0.025); - border: 1px solid lightgray; - border-left: none; - border-right: none; -} - -.hero { - text-align: center; -} - -.hero big { - font-size: 2em; -} - -blockquote { - width: calc(100% - 2rem - 2rem); - border-left: 5px solid lightgray; - padding: 1px 0; - padding-left: calc(2rem - 5px); - padding-right: 2rem; - margin-left: 0rem; - background-color: rgba(0, 0, 0, 0.025); -} - -pre[class*="language-"], -pre.highlight { - width: 100%; - box-sizing: border-box; - max-width: 100vw; - font-size: 1rem !important; -} - -pre.highlight { - background-color: rgba(0, 0, 0, 0.1); - padding: 1rem; - overflow: auto; -} - -code { - background-color: rgba(0, 0, 0, 0.15); - /* padding: 0 0.25rem; */ -} - -.header-anchor { - opacity: 0; -} - -h1:hover>.header-anchor, -h2:hover>.header-anchor, -h3:hover>.header-anchor, -h4:hover>.header-anchor, -h5:hover>.header-anchor, -h6:hover>.header-anchor { - opacity: 1; -} - -details { - max-width: 100vw; - margin-top: 1rem; -} - -details[open] .spoiler-content { - box-sizing: border-box; - padding: 1px 1rem; - background-color: rgba(0, 0, 0, 0.025); -} - -summary { - margin-bottom: 1rem; -} - -figure { - margin: 0; - text-align: center; -} - -figure img { - width: 100%; -} - -figcaption { - font-style: italic; - text-align: center; -} - -article hr { - border: none; - height: 1px; - background-color: lightgray; - width: 3rem; - margin-top: 2rem; - margin-bottom: 2rem; -} - -nav.table-of-contents ol { - /* Would still begin from 1 on Chrome =( */ - /* counter-reset: list-item 0; */ - - counter-reset: list-item -1; - counter-increment: list-item 1; -} - -nav.table-of-contents ol li { - display: block; - counter-increment: list-item 1; -} - -nav.table-of-contents ol li:before { - content: counters(list-item, '.') '. '; -} - -.table-wrapper { - overflow-x: auto; - max-width: 100vw; -} - -table { - border-spacing: 0; -} - -th, -td { - border-bottom: 1px solid rgba(0, 0, 0, 0.2); - padding: 1rem; -} diff --git a/public/styles/posts.css b/public/styles/posts.css deleted file mode 100644 index 8522f9d..0000000 --- a/public/styles/posts.css +++ /dev/null @@ -1,30 +0,0 @@ -.posts { - /* list-style: none; */ - margin-top: 0; - padding-left: 0; -} - -.posts li { - display: grid; - grid-template-columns: 1fr 2fr; - column-gap: 0.5rem; -} - -.posts .date { - text-align: right; -} - -@media (max-width: 768px) { - .posts { - padding-left: 2rem; - padding-right: 1rem; - } - - .posts .date { - display: none; - } - - .posts li { - display: list-item; - } -} diff --git a/public/styles/projects.css b/public/styles/projects.css deleted file mode 100644 index e5f1006..0000000 --- a/public/styles/projects.css +++ /dev/null @@ -1,77 +0,0 @@ -/* TODO: Improve scoping. */ -small.annotation { - text-align: center; - margin-top: -1rem; - margin-bottom: 1rem; -} - -/* TODO: Improve scoping. */ -h1, -h2, -h3, -h4, -h5, -h6 { - margin: 1rem 0; - text-align: center; -} - -ul.projects { - --gap: 1rem; - - display: flex; - flex-wrap: wrap; - max-width: 768px; - padding: 0; - gap: var(--gap); -} - -ul.projects>li.project-card { - --border-width: 1px; - --border-radius: 4px; - --padding: 1.5rem; - - display: block; - width: calc(50% - (var(--padding) * 2) - var(--gap) / 2 - var(--border-width) * 2); - padding: var(--padding); - border-radius: var(--border-radius); - border: var(--border-width) solid rgba(0, 0, 0, 0.1) -} - -ul.projects>li.project-card>.title { - display: block; - margin-bottom: -0.25rem; - font-weight: bold; -} - -ul.projects>li.project-card>p { - margin: 0.5rem 0; -} - -ul.projects>li.project-card>p:last-child { - margin-bottom: 0; -} - -ul.projects>li.project-card .stack { - display: flex; - flex-wrap: wrap; - gap: 0.25rem; -} - -ul.projects>li.project-card .stack>span { - display: block; - padding: 0.25rem 0.5rem; - background-color: rgba(0, 0, 0, 0.1); - border-radius: 4px; - font-size: small; -} - -@media(max-width: 768px) { - ul.projects { - padding: 0 - } - - ul.projects>li.project-card { - width: 100%; - } -}