並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 32 件 / 32件

新着順 人気順

Fibの検索結果1 - 32 件 / 32件

  • 時代がstaticおじさんに追いついてきた(追記あり) - きしだのHatena

    この文章みてください。 オレはもう20年以上システム業界にいるけどな、その長い経験から言うと、オブジェクト指向なんてものは、理論としては面白いけど、およそ実用的とは言い難いものだな。まぁ、例えばGUIのコンポーネントとかはオブジェクト指向に基づいて作られているようだから、そういうツールとかを作る人には必要なものなのかもしれない。しかし君たちがいずれ作ることになる業務アルゴリズムにはまったく無縁のものだと思ってもらって間違いない。どうもこの業界、オブジェクト指向でなければダメ、というような風潮がまかりとおっているけどな、オブジェクト指向なんか本当に使っている人はほとんどいないよ。オレも少し勉強してみたけど、カプセル化とかポリ何とかとか、どうにも利点が理解できなかったね。実際、実業務で使ったことなどないしな…… 「またお前、オブジェクト指向の話をしてるのか」と思ったかもしれませんが、2010年

      時代がstaticおじさんに追いついてきた(追記あり) - きしだのHatena
    • HaskellとRustを足して2で割ったような関数型言語Fixを作っている話 - Qiita

      はじめに ここ1年ぐらいかけて、Fixという名前のプログラミング言語を作っています。 コアとなる機能の実装がある程度落ち着き、実際にFixを使ってプログラムを書けるようになってきたので、そろそろ言語の紹介をしてみようと思います。 本記事はFixのチュートリアルではなく、どういう思想で設計されていて、どういう特徴を持つ言語なのか、という点を紹介するものです。 意見・提案・助言などをいただけるとうれしいです。 リポジトリはこちらです。 ※ コメントやコミットメッセージは一応拙い英語で書いていますが、日本語でissueを立てたりdiscordで意見・質問してもらっても大丈夫です。 ※ 急いで作った部分もあるため、コンパイラのコードは結構汚いです。ご容赦ください。 現状、Fixをローカルで実行するためにはLLVMのインストールが必要で時間がかかりますが、Fix playgroundを使えばブラウザ

        HaskellとRustを足して2で割ったような関数型言語Fixを作っている話 - Qiita
      • bpftraceによるGoアプリケーションのトレース|hayajo

        はじめにシステムの状態を的確に捉え、運用に必要なインサイトを継続的に得るための特性は「オブザーバビリティ」と呼ばれます。オブザーバビリティを実現することで、パフォーマンスのモニタリングやトラブルシューティングを効果的に行い、システムの信頼性を高めることができます。 この重要な特性を実現する上で、eBPFやbpftraceは強力なツールとなります。 本記事では、Goアプリケーションにおけるオブザーバビリティを実現するための一つの方法として、bpftraceを用いたトレースの手法を紹介します。 内容が多いため、目次を活用して段階的に読み進めることをお勧めします。 eBPFとbpftraceはじめに、eBPFとbpftraceについて簡単に説明します。 eBPFとはeBPF(Extended Berkeley Packet Filter)はLinuxカーネル内で動作する柔軟なプログラミングフレー

          bpftraceによるGoアプリケーションのトレース|hayajo
        • 160行で作るシンプルプログラミング言語 - Qiita

          "fib" = (("val") => { (val < 2) ? { val } : { (@fib(val - 1)) + (@fib(val - 2)) } }); @print(@fib(7)); @print(@fib(8)); @print(@fib(9)); @print(@fib(10));

            160行で作るシンプルプログラミング言語 - Qiita
          • Writing a C compiler in 500 lines of Python

            A few months ago, I set myself the challenge of writing a C compiler in 500 lines of Python1, after writing my SDF donut post. How hard could it be? The answer was, pretty hard, even when dropping quite a few features. But it was also pretty interesting, and the result is surprisingly functional and not too hard to understand! There's too much code for me to comprehensively cover in a single blog

            • データプレーンに起きたバグにパッチを当ててみた(インターンシップ体験記) - NTT Communications Engineers' Blog

              はじめに こんにちは、SDPFクラウドでSDN開発を担当している梶浦(@ykajiaaaaa)です。 今回の記事は今夏のインターンシップで私のチームに来ていただいた伊藤さんによるものです。 このインターンシップでは我々が実際に昔出会った問題をベースにトラブルシューティングを行い、その体験記を執筆いただきました。 それではどうぞよろしくお願いします。 目次 はじめに 目次 参加したインターンシップの紹介 配属されたチームについて インターンシップで取り組んだこと 概要 問題の切り分け 現状把握 原因箇所の更なる切り分け 問題の修正 デバッグ方法 ハッシュテーブル エントリの削除 原因の特定 もう1つの問題 トラブルシューティングのまとめ ライブパッチ インターンシップの感想 メンターからのコメント さいごに 参加したインターンシップの紹介 こんにちは、インターンシップ生の伊藤吉彦です。普段は

                データプレーンに起きたバグにパッチを当ててみた(インターンシップ体験記) - NTT Communications Engineers' Blog
              • Scala 3のマクロTips 100連発 - 貳佰伍拾陸夜日記

                この記事はScala Advent Calendar 2023の12日目だ! Scala 3のマクロを書く上で役に立つ, メタれたTipsたちを紹介するぜ! 勢いに任せて書いていくからサンプルコードがちゃんと動かなかったらごめんな. 一応, Scala 3.3.1を想定しているぞ. マクロ 1. メソッドをマクロとして定義する 2. マクロの本体を実装する 3. マクロ実装の記法の意味を知る 4. マクロで生成されるコードの内容を確認する 5. 引数の式を評価せずに使う 6. 返り値の型をマクロの実行結果によって決める 7. マクロの返り値の型を制限する 8. マクロの返り値の型を書かない 9. マクロで計算された型をテストする 10. マクロで計算された型をScalaTestでテストする 式 11. 定数式の値を得る 12. 定数式でなければコンパイルエラーにする 13. 定数値の式を作

                  Scala 3のマクロTips 100連発 - 貳佰伍拾陸夜日記
                • Moonbit: the fast, compact & user friendly language for WebAssembly

                  The importance of WebAssembly (Wasm), a cross-platform Instruction Set Architecture (ISA), is escalating in Cloud and Edge computing, given its efficiency, security, compactness, and open standard. However, its true potential remains untapped. Low level Wasm languages like Rust and C/C++ are challenging to learn and can be slow for developers because of their long compilation time. On the other ha

                    Moonbit: the fast, compact & user friendly language for WebAssembly
                  • 日米首脳の公式夕食会に「YOASOBI」を招待 米側が検討

                    岸田文雄首相が国賓待遇で米国を訪問する際に開かれる公式夕食会に、日本の2人組音楽ユニット「YOASOBI」ら著名人の招待を米側が検討していることが7日分かった。日米外交筋が明らかにした。友好をアピールする狙いがある。 公式夕食会はバイデン大統領側が主催し、10日午後(日本時間11日午前)に開かれる。YOASOBIが昨年リリースした「アイドル」は、ビルボードのグローバルチャート(米国除く)で日本語曲として初めて1位を獲得し、世界でヒットした。

                      日米首脳の公式夕食会に「YOASOBI」を招待 米側が検討
                    • Essays on programming I think about a lot

                      Every so often I read an essay that I end up thinking about, and citing in conversation, over and over again. Here’s my index of all the ones of those I can remember! I’ll try to keep it up to date as I think of more. There's a lot in here! If you'd like, I can email you one essay per week, so you have more time to digest each one: Nelson Elhage, Computers can be understood. The attitude embodied

                      • Ruby might be faster than you think - John Hawthorn

                        I saw a project a couple weeks back which allows writing and running Crystal methods inline inside a Ruby file. It’s a neat project, and I don’t want to take away from it but something in the README example looked off to me. require 'crystalruby' require 'benchmark' module Fibonnaci crystalize [n: :int32] => :int32 def fib_cr(n) a = 0 b = 1 n.times { a, b = b, a + b } a end module_function def fib

                        • Maximum call stack size exceeded について解説

                          "Maximum call stack size exceeded" というエラーに関する解説を書きます。JavaScript を前提に解説しております。 ざっくり解説 Uncaught RangeError: Maximum call stack size exceeded これは、関数が何度も深く深く呼ばれてしまった場合に出るエラーです。 大抵は、間違って自分自身の関数を呼んでしまった、もしくは再帰の終了条件をミスった場合に発生します。 ここに検索で来た方は、自分自身を呼んでいたり、関数同士が循環的に呼びあっていたりするミスを犯していないか確認してください 。 図にすると、こんな感じです ちなみに、関数呼び出しがなければこのエラーは発生しません。ただの無限ループでは決して発生しないエラーです。以下、解説を書きます。 「関数を深く呼ぶ」とは? ここでは、関数からリターンせず再度関数を呼び

                          • Flappy Bird Implemented in Typescript types

                            10/19/2023 Flappy Bird Implemented in Typescript types The ultimate type-level trickery I wrote a 2D flappy bird game, purely in Typescript types: Yes you heard that right, this game is written entirely in Typescript type annotations, which—if you didn’t know—are Turing complete. So how the hell am I runnning it in the browser and rendering the game in Typescript types? The basic rundown is that I

                            • Beating the compiler

                              In modern times, everyone knows that writing assembly is a fool's errand: compilers are the result of literal engineer-centuries of work, and they know the processor much better than you do. And yet – one hears rumors. Written in ancient tomes, muttered in quiet watering holes, scrawled on the walls of bygone temples, hinted at by mysterious texts; the rumors paint a specific picture: Compilers ar

                              • HTML: The Programming Language

                                Introduction HTML, the programming language, is a practical, turing-complete[1], stack-based programming language based on HTML, the markup language. It uses elements defined in HTML, the markup language, in order to do computations. To give you a sense of what HTML, the programming langauge, looks like, below is a sample program that prints the values from 1 to 10 to standard out (console.log) A

                                • とも ちゃ日記(Tomo cha) - 元大学生のOL日記-

                                  わたしの日記は日々の出来事の鬱憤晴らしの毒だし日記がメインです。 相当病んでいます。くだを巻いています。許容出来る方のみのアクセスをお願いします。 また、この日記へのリンクは原則自由にして頂いても結構ですが、 写真への直リンクを張るのはご遠慮下さい。内容に関しては、一切保証致しません。 カテゴリ一覧 Network, Internet, IPv6, DC, NTT, Comp, Linux, Debian, FreeBSD, Windows, Server, Security, IRC, 大学, Neta, spam, 食, 生活, 遊び, Drive, TV, 仕事, seirios氏がAmazonでポチって面白いデバイスを持ってきたので、軽く検証、面白い結果が得れたので私も合計で5台ほど調達することにした。 検証した機器は、 八丁 seekswan XikeStor SKS8300-8

                                  • An mruby for WebAssembly

                                    Previous slideNext slideToggle fullscreenOpen presenter view An mruby for WebAssembly Presentation by Uchio Kondo self.introduce! Uchio Kondo from Fukuoka.rb Infra Engineer @ Mirrativ, Inc. livestreaming & "live" gaming Translator of "Learning eBPF" Ruby and WebAssembly Code sample background rule: Ruby.has :red, :background (window.JavaScript || TypeScript).then("yellow"); Rust::<BackGround>::pur

                                      An mruby for WebAssembly
                                    • An MIR-based JIT prototype for Ruby | Red Hat Developer

                                      I am a GCC compiler engineer, and for the past 15 years, I have primarily focused on the GCC register allocator and instruction scheduler. The major development of the GCC register allocator and instruction scheduler was completed quite some time ago, and these days, my main responsibility is maintaining these essential GCC components. About six years ago, I began dedicating half of my work time t

                                        An MIR-based JIT prototype for Ruby | Red Hat Developer
                                      • Rust で JSON5 を実行するインタプリタを作って自作言語の高速スタートアップをしよう|TechRacho by BPS株式会社

                                        こんにち自作言語!(挨拶) 世の中のには 2 種類の人がいます。自作言語を作っている人と、これから自作言語を作る人です。(筆者の脳内調査) いや別に自作言語作らない人もいるだろって思いました? こんなタイトルの記事を読んでいるのだからあなたはこのどちらかですよね? どちらでもない? じゃあこれから自作言語を作る人になってください(圧) かく言う私も長年自作言語ワナビーをやっており、ときおり制作に手を付けては放置し、結局なかなか作れずにいるという現状で、ここをどうにか突破したい、と思いこの記事を書いています。 あっちなみに、言うまでもないとは思いますがこの記事における言語=プログラミング言語です。クウェンヤとかシンダールとかエスペラントとかリパラインとかの世界ではないです。ちなみにあっちはよく「人工言語」という言葉が使われるっぽいですね。もっとも「人工言語」は「自然言語」に対比する言葉で、プ

                                          Rust で JSON5 を実行するインタプリタを作って自作言語の高速スタートアップをしよう|TechRacho by BPS株式会社
                                        • Yes, Ruby is fast, but…

                                          John Hawthorn wrote a nice post discussing a recent tool to incorporate Crystal into your Ruby app. While JH brings an important point, it overlooks certain aspects that are worth consideration. I'll discuss Crystal's real performance and benefits, highlighting why such Ruby/Crystal integration is an indispensable tool to have on the bench. This is also a structured presentation of some comments m

                                            Yes, Ruby is fast, but…
                                          • Announcing Rust 1.77.0 | Rust Blog

                                            The Rust team is happy to announce a new version of Rust, 1.77.0. Rust is a programming language empowering everyone to build reliable and efficient software. If you have a previous version of Rust installed via rustup, you can get 1.77.0 with: $ rustup update stable If you don't have it already, you can get rustup from the appropriate page on our website, and check out the detailed release notes

                                              Announcing Rust 1.77.0 | Rust Blog
                                            • The Art of Forking: Unlocking Scalability in Ruby

                                              Introduction The journey towards efficient parallelization in library development has often been based on using threads. As Karafka celebrates its eighth anniversary, it's become clear that while threads have served us well for many tasks, there's room to explore further. That's why I've decided to introduce forking capabilities into Karafka, aiming to offer another dimension of parallelization to

                                                The Art of Forking: Unlocking Scalability in Ruby
                                              • Rubyは思ったより速いかもしれないとの指摘 | ソフトアンテナ

                                                国産プログラミング言語「Ruby」は、インタプリタ型のプログラミング言語であるため、「処理速度が遅そう」というイメージを持つ開発者の方もいるかもしれません。 しかし今回、Rubyで書かれたプログラムも工夫次第で十分高速に操作することを、John Hawthorn氏はブログ記事「Ruby might be faster than you think」で指摘し、Hacker NewsやRedditで注目を集めています。 同氏が例として掲載しているのは、crystalrubyと呼ばれる、Rubyの中からCrystalを呼び出すためのgemのサンプルプログラムです。 CrystalはRubyに似た構文を採用した静的型付けプログラミング言語です。 フィボナッチ数を計算するプログラムで、Pure Ruby版のfib_rbとCrystalのコードを呼び出すfib_crの実行速度を比較しています。 req

                                                  Rubyは思ったより速いかもしれないとの指摘 | ソフトアンテナ
                                                • mruby/edge 超入門 + VMって何?

                                                  Previous slideNext slideToggle fullscreenOpen presenter view mruby/edge 超入門 RubyKaigi の前に知っとくと便利かもしれない気がすること Uchio Kondo 近藤うちお 所属: 株式会社ミラティブ 福岡市エンジニアカフェ ハッカーサポーター フィヨブーアドバイザー 普段はGoでミドルウェアの 開発・運用をしてます 『入門 eBPF』(オライリージャパン)翻訳しました何卒 今日の内容 主に話すこと mruby/edge っち何? VM って何? 遺憾ながらあんまり話せないこと WebAssembly自体の話... mruby/edgeとは mruby/edgeとは? 一言で: mrubyをwasm上で動かすのに特化したVM実装 Rustで書いた あらゆる機能がないが、fibは動かせる RubyKaigi 20

                                                    mruby/edge 超入門 + VMって何?
                                                  • ララさんはTwitterを使っています: 「ある人が夏に卵がけご飯を食べようと 熱々のご飯に生卵をかけたら そこにちょうど電話が鳴り 30分ほどおしゃべりして切り さきほどの卵がけご飯を食べたところ なんと、お亡くなりになってしまいました。 原因はサルモネラ菌中毒でした。 気をつけましょう。 https://t.co/bmGXjA9fIb」 / Twitter

                                                    • Scheme in Scheme on Wasm in the browser -- Spritely Institute

                                                      Hey, folks! Today we want to talk about the wonderful read-eval-print-loop (REPL). Thanks to WebAssembly (Wasm), it's becoming increasingly common for programming language websites to embed a REPL in which passersby can easily evaluate code and get a feel for the language without having to install anything on their computer. We'd like to do the same thing for our language of choice, Guile Scheme,

                                                        Scheme in Scheme on Wasm in the browser -- Spritely Institute
                                                      • どういう時に型注釈を書くか - Qiita

                                                        最近のプログラミング言語は何らかの型推論を搭載したものが多いです。しかし、型推論も万能ではなく、ところどころで型注釈を書かないとコンパイルが通らない、あるいは意図せず any 型になってしまう、という状況があります。 この記事では、どういう場合に型注釈を書くべきかについてのガイドとなることを目指します。 主に、「HaskellやMLほどではないがある程度の型推論ができる」言語、具体的にはTypeScript, Python(mypy等)、C#、Swiftなどを想定しています。特定の言語についてのガイドではないので、全体的にふわふわした記述になっているかもしれません。 関数の型を書くべきか トップレベル関数の引数は、注釈が必要なことが多いです。一部の言語、HaskellやMLなどは引数の使われ方から型を推論できたりしますが、他の多くの言語はそこまでの能力を持っていません。 戻り値の型について

                                                          どういう時に型注釈を書くか - Qiita
                                                        • Nature Programming Language | Nature Programming Language

                                                          Natureis a programming language and compiler, may you be able to experience the joy of programming. GET STARTEDDOWNLOAD import fmt fn fib(int n):int { if n <= 1 { return n } return fib(n - 1) + fib(n - 2) } fmt.printf('fib result is %d', fib(30)) Functions DefinedA fib evaluation function was defined using recursion. Call the fib function and pass its result to fmt.printf for output.

                                                            Nature Programming Language | Nature Programming Language
                                                          • Rubyでつくる、ミニでRubyなコンパイラ - ESM アジャイル事業部 開発者ブログ

                                                            こんパイラ〜(挨拶)、電子の海に漂うはかなき泡沫(うたかた)、はたけやまです。 みなさん、書籍「RubyでつくるRuby」をご存知ですか?Rubyを使ってRubyのサブセット「MinRuby」のインタプリタを作ることで言語処理系作成のエッセンスを学ぼう!という本です。 RubyでつくるRuby https://www.lambdanote.com/products/ruby-ruby 今回は、この本のMinRubyを題材に、簡易なMinRubyコンパイラをRubyで作成してみようと思います。 (この記事は ESM Advent Calendar 2023 の4日目の記事になります) Gitリポジトリ 今回作成したコンパイラのソースはこちらのgitリポジトリに置いてます。 https://github.com/thata/minrubyc-m1 言語仕様とターゲット環境 言語仕様 MinRu

                                                              Rubyでつくる、ミニでRubyなコンパイラ - ESM アジャイル事業部 開発者ブログ
                                                            • mruby/edge ってブラウザで動くんですか? - ローファイ日記

                                                              A: 動きます。 mruby/edge 0.1.4/mec 0.2.3 では、 --no-wasi というオプションをサポートしたので、とりあえずwasiに関わらないコードであれば(fibとか、フィボナッチ数の計算とか)ブラウザでも動かしやすくなりました。 いつものfib置いときます。 def fib(n) # fib.rb if n < 2 return 1 else return fib(n-1)+fib(n-2) end end # fib.export.rbs def fib: (Integer) -> Integer これをコンパイルしますよと。 $ cargo install --version 0.2.3 mec $ mec --no-wasi fib.rb $ file fib.wasm fib.wasm: WebAssembly (wasm) binary module

                                                                mruby/edge ってブラウザで動くんですか? - ローファイ日記
                                                              • Maybe Everything Is a Coroutine - Adam Nelson

                                                                I was inspired, after reading the excellent blog post Let Futures Be Futures, by the author's thought experiment of a language in which all functions are coroutines and this is used to express asynchronicity: async functions can yield a type called Pending when awaiting some async action, while pure, synchronous functions can yield Never, indicating that they never yield at all. The more I thought

                                                                • LEAN JA

                                                                  Lean について Lean は容易に正しく保守性の高いコードを書くことができるよう設計された,純粋関数型言語です.依存型という表現力の高い型システムを備えており,アルゴリズムなどが本当に意図したものを返すことを証明することができます. Lean は証明支援系でもあり,数学の証明を検証する能力を備えています.Lean で証明を書いている限り,コンパイルが通れば証明は正しいと自信を持つことができます. そして Lean はパワフルです.いま示すべきことと得られていることを逐一表示できるのはもちろん,証明の一部を自動化したり,強すぎる仮定を自動的に検出したりすることもできます. import Mathlib.Tactic /-- フィボナッチ数列の線形時間の実装 -/ def fib (n : Nat) : Nat := (loop n).1 where -- ヘルパー関数を定義する loop

                                                                  1