You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Introduction Performance is important for many Rust programs. This book contains techniques that can improve the performance-related characteristics of Rust programs, such as runtime speed, memory usage, and binary size. The Compile Times section also contains techniqu
Acton is a general purpose programming language, designed to be useful for a wide range of applications, from desktop applications to embedded and distributed systems. In a first approximation Acton can be described as a seamless addition of a powerful new construct to an existing language: Acton adds actors to Python. Acton is a compiled language, offering the speed of C but with a considerably s
In a recent podcast about Rust leadership, the BDFL question came up again and Jeremy Soller said (in the understatement of the century) that "I believe Graydon would have said no to some things we all like now". And this echoes a different conversation on reddit where I was reminded that I meant to write down at some point how "I would have done it all differently" (and that this would probably h
The diagram above is the compiler for the language Bolt we’ll be building. What do all the stages mean? I have to learn OCaml and C++? Wait I haven’t even heard of OCaml… Don’t worry. When I started this project 6 months ago, I had never built a compiler, nor had I used OCaml or C++ in any serious project. I’ll explain everything in due course. In this series of posts we’ll be building a proper pr
日経クロステックが実施した「プログラミング言語利用実態調査2023」で「今後、スキルアップしたいと思う言語はどれですか」と複数回答可で尋ねたところ、トップ10の言語が分かった。それぞれの言語の特徴を解説する。 4位 Rust 多機能でC/C++並みに高速。ただし、難易度は高め 2015年に最初の安定版である「Rust 1.0」がリリースされたRustは、近年人気が高まっているプログラミング言語です。Rustの魅力は、高速に動くプログラムを、現代的なプログラミングテクニックを使うコードで作成できることです。これはプログラミング言語の歴史から見ても興味深い点です。 近年、プログラミング言語の進化の方向は、PythonやRubyのように実行速度を犠牲にする代わりに様々な機能を提供するか、Go言語のように提供する機能を絞って実行速度の向上を追求するかという2つの道に分かれていました。その中で、Ru
L1: r1 = y;L2: r2 = x; 並列プログラムには非決定性があるので、結果はひとつには決まりません。いくつかパターンを考えてみると、 r1, r2 = (NEW, NEW), (0, NEW), (NEW, 0) の可能性があることがわかります: S1 < S2 < L1 < L2 → (NEW, NEW)S1 < L1 < S2 < L2 → (0, NEW)S2 < L2 < S1 < L1 → (NEW, 0) では r1, r2 = (0, 0) という結果はありうるでしょうか? 少し考えてみるとこれはなさそうに思えます: r1 = 0を仮定するこのときL1 < S2である各コアのプログラムの順序よりS1 < L1, S2 < L2である2と3よりS1 < L1 < S2 < L2という順序が決定されるS1 < L2よりr2 = NEWである 以上の「素朴な推論」は正
Scrapscript is a small, pure, functional, content-addressable, network-first programming language. My previous post introduced the language a bit and then talked about the interpreter that Chris and I built. This post is about the compiler that Chris and I built. In the beginning, there was an interpreter Writing a simple tree-walking interpreter is a great way to prototype a language implementati
古から存在するプログラミング言語Lisp。その通り名の一つに「神の言語」というものがある。 なんという甘美な響きだろうか。この名前だけで男子中学生は全員習得することを決心するだろう。そのくらいインパクトのある名前である。文部科学省はプログラミング教育を推進するにあたって、この通り名を公式に採用することを真剣に検討されると良いと思う。 さて、「神の言語」の勉強を始めてみて驚くだろう。どのあたりが神なのかよくわからないのだ。たしかに丸括弧は多い。多いが、それと神との関連性はよくわからない。 何か土着の信仰の話なのだろうか?あなたがそう戸惑うのも無理からぬことだ。 私自身、前からこのフレーズは聞いたことがあったが、あまり理解していなかった。そこで今回改めて調べてみたので共有しようと思う。 「神の言語」の由来 そもそも、Lispは神の言語だと誰が言い出したのか?どうやら海外でそのような歌が作られた
はじめに Rustの特徴としてはメモリ安全性やGCなしで高速といったことがよく挙げられます。それらもRustの利点ではありますが、個人的に魅力を感じる部分の一つに「厳密な型付けをする文化」があると思っています。それはあまり明文化されておらず、個人的に感じているだけなのですが、Rustを使う動機の1つになりうると思うので、ここで宣伝してみます。 ちなみにこの記事のきっかけの1つが アンサー: なぜTypeScriptの型定義に凝るのか です。これを読んでいて、「自分はRustの型付け方針が好きなんだなぁ」とあらためて気づきました。 技術的な正確性より「気持ち」多めなのでポエムということで。 「厳密な型付けをする文化」とは Rustは静的型付き言語なので、ソースコード上の様々なところで型付けが行われます。これ自体は他の静的型付き言語と同様ですが、Rustではどのような型を付けるかということにつ
The run-time speed and memory usage of programs written in Rust should about the same as of programs written in C, but overall programming style of these languages is different enough that it's hard to generalize their speed. This is a summary of where they're the same, where C is faster, and where Rust is faster. Disclaimer: It's not meant to be an objective benchmark uncovering indisputable trut
Today, we’re going to learn how modern programming languages are governed. I’ll explain how Swift’s dictatorial structure is uniquely terrible, and demonstrate to you how bad the situation has become. But first; a quick history lesson on Swift. A Brief History of Swift Swift was the passion project of Chris Lattner, creator of LLVM and senior director of dev tooling at Apple. Across evenings and w
Tree calculus is minimal, Turing-complete, reflective, modular Tree Calculus was discovered by Barry Jay. Check out his book and blog! The demos on this website were developed by Johannes Bader. See here for more background, resources and contact info. Minimal There is one operator △ that computes whenever it is acting on three values. Grammar: E ::= △ | E E Visually, △ is a tree node and the appl
Preface ¶ I started this paper in 2013, and in 2015 sent it out for review to the people listed later on. After incorporating comments, I sent it to Rik Farrow, the editor of the USENIX magazine ;login: to see if he would publish it. He declined to do so, for reasonably good reasons. The paper languished, forgotten, until early 2018 when I came across it and decided to polish it off, put it up on
新しいシステムプログラミング言語Nim・日本初の解説書! 『プログラミングNim』発行! 技術の泉シリーズ、8月の新刊 インプレスグループで電子出版事業を手がける株式会社インプレスR&Dは、『プログラミングNim』(著者:浅田 睦葉)を発行いたします。 最新の知見を発信する『技術の泉シリーズ』は、「技術書典」や「技術書同人誌博覧会」をはじめとした各種即売会や、勉強会・LT会などで頒布された技術同人誌を底本とした商業書籍を刊行し、技術同人誌の普及と発展に貢献することを目指します。 『プログラミングNim』 https://nextpublishing.jp/isbn/9784844379560 著者:浅田 睦葉 小売希望価格:電子書籍版 1,800円(税別)/印刷書籍版 2,400円(税別) 電子書籍版フォーマット:EPUB3 印刷書籍版仕様:B5判/カラー/本文282ページ ISBN:97
こちらはPostgreSQL Advent Calendar 2022 カレンダー2枚目・15日目の投稿となります。 前回は、@hmatsu47さんのSupabase で TCE(透過的列暗号化)を軽く試してみたでした。 はじめにこんにちは、フューチャーでアルバイトをしている齋藤です。以前は同社のインターンでSQLフォーマッタを作成していました(記事)。現在はインターン中に作成していたSQLフォーマッタをPostgreSQLの構文に対応させる作業に取り組んでいます。 このフォーマッタではSQLパーサにtree-sitter-sqlを利用していますが、対応していない構文がいくつか存在します。本記事では、未対応の構文であるBETWEEN述語を例に、tree-sitterの構文拡張の手順を紹介します。開発中のSQLフォーマッタはOSS公開予定ですので、ぜひ仲間を増やしたいという思いから記事にしま
#Zinc, a systems programming language prototype Zinc is my attempt at a low-level systems programming language. I found this parser, called Owl mirrored here, that generates parsers for visibly pushdown languages. Visibly pushdown languages are those where recursion to other grammar productions must be guarded by tokens which can only be used for that purpose. While somewhat limiting, this ends up
こんにちは、広報の坂井(@hana_yonde)です! ZOZOテクノロジーズでは月に1度、技術顧問であるまつもとゆきひろさん(通称:Matz)とのオンラインミーティングを実施し、勉強会を行っています。 「社員なら誰でも参加自由!」ということで、ミーティングにお邪魔してきました!社員があれこれ聞いていたので、当日出た質問とMatzさんからの回答を抜粋してお届けしたいと思います。 Rubyの人気が低下…?日本のプログラマーのガラパゴス化についてー 最近、プログラミング言語の人気ランキングなどで「Rubyの順位が徐々に下がってきている」と感じることがあります。Rubyの人気がなくなってしまうと、日本のプログラマーがガラパゴス化するというか、世界から孤立してしまうんじゃないかなと思っているのですが、MatzさんはじめRubyを作っている方たちはどう考えていらっしゃるのでしょうか? Matz:ご質
今回は Python のスクリプトにおいてエントリーポイントとなる main 関数を定義することのメリットについて説明します。 # わざわざ main 関数を定義してその中に処理を書く def main(): ... if __name__ == "__main__": main() Python では本来 main 関数を定義する必要はありませんが、経験者が書いたスクリプトではよく main 関数が書かれています。 筆者は Python を学び始めた頃にそのようなコードを見て「必要ないものをなぜわざわざ書くのだろう?」と疑問に思いました。 今回は筆者自身がかつて抱いたこの疑問に答えてみます。 尚、 main という名前を使うのはただの慣習です。 この名前の関数にしないといけない制約は特にありません。 本記事において、「 main 関数を定義する」というのは、正確には上のコードのように m
The jank programming language jank is a general-purpose programming language which embraces the interactive, value-oriented nature of Clojure as well as the desire for native compilation and minimal runtimes. jank is strongly compatible with Clojure and considers itself a dialect of Clojure. Please note that jank is under heavy development; assume all features are planned or incomplete. Where jank
This repo is still very early and rough, it's mostly just notes, speculative writing, and exploratory theorem proving. Most of the files in this repo are just "mad scribblings" that I haven't refined enough to actually stand by! If you prefer video, this presentation talks about the core ideas that make formal verification and Magmide possible, and the design goals and intentions of the project: I
dataclassesとは pythonのdataclassesモジュールは、データを格納するためのクラスを定義し、データ格納クラスのための様々な機能を含んだモジュールです。 データ格納のための、と言うとふんわりした印象になりますが、クラス変数を初期化するための__init__()関数を自動生成してくれるため、クラスの定義がシンプルになります。またデータ格納を目的とするクラスの場合__init__()に大量の引数を記載する必要がありますが、自動生成されることによりその必要も無くなります。 データ格納といった目的以外にも様々な用途に用いることが考えられると思います。 dataclassesはPython3.7から追加になりました。本記事はPython3.9のドキュメント、ソースコードを参照して執筆しています。 基本的な使い方 dataclassesモジュールを用いたデータ格納クラスを作成する
はじめに Lua好きですか? ええ、そうですよね、好きでも嫌いでもないですよね。わかります。 Luaが好きで好きでしょうがないという人はいません。ごめん、言い過ぎた。大抵は自分の使っているアプリのスクリプティング機能がLuaだからAPIを叩くために仕方なく使うという人が多いのではないでしょうか。 私のよく使うDTM分野のアプリでもReaperのReaScript、FalconのUVI Script、KONTAKTのCREATOR TOOLS、HALionのHALion ScriptなどLuaによるスクリプティングができるものがあります。Synthesizer Vも音程や表現の自動調整のためにLuaが使えます。その他Robloxのようなゲームエンジン、画像・動画編集アプリなどでもLuaによるスクリプティング機能が搭載されることが増えてきました。 Lua公式サイト、公式リファレンスの内容は充実
ポール・グレハムの記事の一つにWhat Makes Lisp Different?というものがある: www.paulgraham.com ポール・グレハムらしくよく書かれていて、C言語などと比較した場合のLispの特徴をうまく捉えているように思う。 その中の一つが Recursion. Recursion existed as a mathematical concept before Lisp of course, but Lisp was the first programming language to support it. (It's arguably implicit in making functions first class objects.) こうある通り、私も今まで深く考えたこともなく「プログラミングにおける再帰はLispが由来」と考えていたのだが、前回の記事を書く
「Rustの所有権が難しい」という話しがときどきありますが、所有権システムの理解を助ける記事にしてみたいと思います。 所有権とはリソースを開放する権利のこと 所有権とは関数がリソース(資源)を開放する権利のことです。所有するというより消費されてしまうイメージに近いです。 以下のように変数の束縛での解説が多いですが、たぶんつまずくのは関数のほうかなと。 let a = String::from("abc"); let b = a; println!("{}", a); // bに所有権が移動するのでコンパイルエラー let c: u32 = 1; let d: u32 = c; println!("c = {}, d = {}", c, d); // 基本データ型はCopyトレイトを実装しているのでコンパイル可能 というわけで、ここから関数の例で解説します…。 以下のfoo関数はb: Bar
新星プログラミング言語Julia。 Rubyの動的さとC言語の速度を両立させた、公認会計士の資格を取得したジャニーズJr.みたいな、そんなのアリかよって感じの言語だ。 Juliaの宣伝文句はすごい。引用してみよう。 僕らが欲しい言語はこんな感じだ。まず、ゆるいライセンスのオープンソースで、Cの速度とRubyの動的さが欲しい。Lispのような真のマクロが使える同図象性のある言語で、Matlabのように分かりやすい数学の記述をしたい。Pythonのように汎用的に使いたいし、Rの統計処理、Perlの文字列処理、Matlabの線形代数計算も要る。シェルのように簡単にいくつかのパーツをつなぎ合わせたい。チョー簡単に習えて、超上級ハッカーも満足する言語。インタラクティブに使えて、かつコンパイルできる言語が欲しい。 (そういえば、C言語の実行速度が必要だってのは言ったっけ?) こんなにもワガママを言った
TinyCompiler: a compiler in a week-end Introduction Have you ever wondered how a compiler works, but you never found courage to find out? Then this series of articles is for you. I have never had the chance to look under the hood either, but one week-end I have decided to to write a translator from the esoteric programming language wend (short for week-end), which I just invented myself, into regu
You can now test Tao in the browser! A statically-typed functional language with polymorphism, typeclasses, generalised algebraic effects, sum types, pattern-matching, first-class functions, currying, good diagnostics, and much more! For more example programs, see... hello.tao: Hello world input.tao: Demonstrates a more complex example of IO effects calc.tao: A CLI calculator, demonstrating parser
自作Cコンパイラではすべて自分で実装してみるというつもりでCコンパイラ、プリプロセッサ、アセンブラを作ってきたが、ついに欠けている最後の要素だったリンカーを作った。 今まではアセンブラですべてのアセンブリコードを受け取って、マシンコード生成とラベルのアドレスを解決して直接ELF形式の実行ファイルを出力していた。 それでほとんど問題はないんだけど、リンカーが使えるとオブジェクトファイルを生成しておくことで分割コンパイルできるようになりコンパイル時間が短縮できたり、 他のコンパイラの出力結果も使用できるようになるという利点がある。 またリンカーがなくてすべてのコードを一緒にアセンブルしていることにより、ソースファイル中の static 変数や関数でも実際には漏れてしまっているため、プログラム全体で衝突しない名前を使う必要があるという欠点があった。 アセンブラからは実行ファイルだけじゃなくオブジ
TLDR Ruby under the Microscopeと言う本の輪読会をやっていて、JITまわりで気になった部分があったので、解説します。 今、有志でRuby under the Microscopeという本を輪読しています。 この本はRubyのしくみという邦題で訳されてもいて、Rubyが内部でどうやって動いているのか、とても丁寧に解説されています。 2014年にすでに本は出ていて、その頃に購入はしていたのですが、今まで積読していました。 JITとは何か JITとは「Just in Time」の頭文字で、その名の通り「必要な分を、必要な時に」コンパイルするコンパイラのことです。 なぜ今読むのか 今週、Ruby edgeブランチにでYJITというRailsパフォーマンス向上が期待できる新しい種類のJITがマージされました。PRはこちら。たまたま、その開発者・チームと同じ会社(Shopi
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く