[フレーム]
1 - 19 件 / 19件
以前、Salvatore Sanfilippo氏によって開発されたエディタ「Kilo」を取り上げたところ、高い関心を集めた。Kiloはclocカウントでソースコードが1000行以下で、しかもcursesなどのライブラリも使っていない。VT100の基本的なエスケープシーケンスとlibcで提供されている機能だけを用いて実装されたエディタで、シンタックスハイライトにも対応している。C言語1000行程度でここまで実用的なエディタが開発できるというのは、教育向けの素材として興味深い。 本連載では、Kiloのソースコードを読み、どのような仕組みでエディタが作られているかについて紹介する。C言語でソフトウェアを開発する際に利用する機能が網羅されており、学習素材としてなかなかのポテンシャルを持っている。エディタがどのように実装されているのかを知るためにも、一度は読んで見てほしいソースコードだ。 頭から読む
GitHubに400行以下で構成されたオペレーティングシステムが登録された。オペレーティングシステムは「resume_operating_system」と呼ばれている。開発の動機や仕組みなどに関する説明は「My resume in an Operating system」にまとまっている。オペレーティングシステムの基本構造を理解する際に役に立つ。 このオペレーティングシステムはMathieu Passenaud氏が学生時代に作成したオペレーティングシステムの基礎実装をまとめたもの。開発者の経歴を表示するだけという目的で作られた趣味的な取り組みの成果物であるため、明確に名称がついていない。GitHubに登録した名前が「resume_operating_system(経歴オペレーティングシステム)」であるため、この名称で呼ばれている。 resume_operating_systemではテキスト
News [Note: I am no longer working on TCC. Check the mailing list to get up to date information.] Features SMALL! You can compile and execute C code everywhere, for example on rescue disks (about 100KB for x86 TCC executable, including C preprocessor, C compiler, assembler and linker). FAST! tcc generates x86 code. No byte code overhead. Compile, assemble and link several times faster than GCC. UN
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
Today, let's drop into a world you can reach out and touch. In this article, we'll compose a first-person exploration from scratch, quickly and without difficult math, using a technique called raycasting. You may have seen it before in games like Daggerfall and Duke Nukem 3D, or more recently in Notch Persson's ludum dare entries. If it's good enough for Notch, it's good enough for me! [Demo (arro
It has come to my attention that I have not been particularly clear about how usable or feature-complete libui is, and that this has fooled many people into expecting more from libui right this moment than I have explicitly promised to make available. I apologize for not doing this sooner. libui is currently mid-alpha software. Much of what is currently present runs stabily enough for the examples
What is it ? The Obfuscated Tiny C Compiler (OTCC) is a very small C compiler I wrote in order to win the International Obfuscated C Code Contest (IOCCC) in 2002. My goal was to write the smallest C compiler which is able to compile itself. I choose a subset of C which was general enough to write a small C compiler. Then I extended the C subset until I reached the maximum size authorized by the co
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
TClockでは、「デフォルトライブラリ(ランタイムライブラリ)をリンクしないことによって、実行ファイルのサイズを小さくする」というテクニックを使っています。TClock LightのMakefileやソースの#ifdefで何やってるのか詳しく知りたいときは、このページの情報を参照してください。 このテクニックは、「実行ファイルが小さいほうが気持ちいい」という作者の単なる好みによるもので、ふつうのC言語でふつうにプログラムする際には、役に立たない、覚えなくてよいものです。 TClock Lightのソースを改良したい人は、Makefileを編集して、デフォルトライブラリをリンクする設定に変えることをお勧めします。TClock LightのMakefileは、デフォルトライブラリをリンクするかどうかを、簡単に切り替えられるようにしてあります。 Visual C++では、次の行を削除します。
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
cursesなどのライブラリも使わずに、C言語1000行ほどで開発されたエディタ「Kilo」のソースコードを読む本連載。前回、main()から流れを追って、Kiloの処理の内部構造がおおむね以下のような感じになっていることを説明した。 ターミナルに画面分文字を出力 キー入力を待つ 入力されたキーに応じて処理を実施 1.に戻る 2回目となる今回は、実際に関数を追いながら、キー入力を待っている部分まで処理をたどってみよう。まず、main()関数の該当部分だけを抜粋したものを以下に示そう。 int main() { while(1) { editorRefreshScreen(); editorProcessKeypress(STDIN_FILENO); } } 処理としてはmain()関数の内部のeditorProcessKeypress()の部分でキー入力を待っているんだろうな、ということが
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
I set myself a challenge: write a self-hosting C compiler in 10 hours. This is the result, plus lots of cleanup (check "releases" for the 10 hour version). Implementation: Generates 32-bit x86 assembly, which is then assembled and linked by GCC. It is all implemented in a single pass. Code generation is mixed with parsing. This requires some creativity. The parser peeks at the next token to decide
About the zoo The Programming Languages Zoo is a collection of miniature programming languages which demonstrates various concepts and techniques used in programming language design and implementation. It is a good starting point for those who would like to implement their own programming language, or just learn how it is done. The following features are demonstrated: functional, declarative, obje
Dimitrios Souflis dsouflis@acm.org Kevin Cozens kevin@REMOVEMEve3syb.ca Jonathan S. Shapiro shap.nospam@eros-os.org TinyScheme is a lightweight Scheme interpreter that implements as large a subset of R5RS as was possible without getting very large and complicated. It is meant to be used as an embedded scripting interpreter for other programs. As such, it does not offer IDEs or extensive toolkits a
TinySCHEME は scheme 実装の一つで、コード量は 4千行程度である。R5RS の大部分の仕様が実装されており、学習のためにソースを読む機会があったので記録しておく。 TinySCHEME のソースはインデントが統一されていなかったり、数字と演算子の間の空白が極端に少なかったりと、可読性はあまり高いとは言えないので、私は整形してから読んだ。 文中、ファイル名を明示せず行数が出てくるものは全て scheme.c のものである。それ以外のファイルについてはファイル名を明示してある。 TinySCHEME のソースを読む -1 セルの構造 TinySCHEME のソースを読む -2 シンボル、環境 TinySCHEME のソースを読む -3 TinySCHEME の処理エンジン TinySCHEME のソースを読む -4 トップレベルからの処理の流れ TinySCHEME のソース
(Keep It) Simple Stupid Database KISSDB is about the simplest key/value store you'll ever see, anywhere. It's written in plain vanilla C using only the standard string and FILE I/O functions, and should port to just about anything with a disk or something that acts like one. It stores keys and values of fixed length in a stupid-simple file format based on fixed-size hash tables. If a hash collisio
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
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く