並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 12 件 / 12件

新着順 人気順

simple if elif else program in pythonの検索結果1 - 12 件 / 12件

  • 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

    • Implementing Logic Programming

      Most of my readers are probably familiar with procedural programming, object-oriented programming (OOP), and functional programming (FP). The majority of top programming languages on all of the language popularity charts (like TIOBE) support all three to some extent. Even if a programmer avoided one or more of those three paradigms like the plague, they’re likely at least aware of them and what th

        Implementing Logic Programming
      • Building a Toy Programming Language in Python

        I thought it would be fun to go outside of my comfort zone of web development topics and write about something completely different and new, something I have never written about before. So today, I'm going to show you how to implement a programming language! The project will parse and execute programs written in a simple language I called my (I know it's a lame name, but hey, it is "my" language).

          Building a Toy Programming Language in Python
        • My thoughts on writing a Minecraft server from scratch (in Bash)

          My thoughts on writing a Minecraft server from scratch (in Bash) For the past year or so, I've been thinking about writing a Minecraft server in Bash as a thought excercise. I once tried that before with the Classic protocol (the one from 2009), but I quickly realized there wasn't really a way to properly parse binary data in bash. Take the following code sample: function a() { read -n 2 uwu echo

          • Dynamic Programming is not Black Magic - Quentin Santos

            This year’s Advent of Code has been brutal (compare the stats of 2023 with that of 2022, especially day 1 part 1 vs. day 1 part 2). It included a problem to solve with dynamic programming as soon as day 12, which discouraged some people I know. This specific problem was particularly gnarly for Advent of Code, with multiple special cases to take into account, making it basically intractable if you

              Dynamic Programming is not Black Magic - Quentin Santos
            • Rust on MIPS64 Windows NT 4.0

              Introduction Some part of me has always been fascinated with coercing code to run in weird places. I scratch this itch a lot with my security research projects. These often lead me to writing shellcode to run in kernels or embedded hardware, sometimes with the only way being through an existing bug. For those not familiar, shellcode is honestly hard to describe. I don’t know if there’s a very form

                Rust on MIPS64 Windows NT 4.0
              • Python behind the scenes #11: how the Python import system works

                If you ask me to name the most misunderstood aspect of Python, I will answer without a second thought: the Python import system. Just remember how many times you used relative imports and got something like ImportError: attempted relative import with no known parent package; or tried to figure out how to structure a project so that all the imports work correctly; or hacked sys.path when you couldn

                • A Deep Dive into eBPF: Writing an Efficient DNS Monitoring.

                  eBPF / XDP is an in-kernel virtual machine, provides a high-level library, instruction set and an execution environment inside the Linux kernel. It’s used in many Linux kernel subsystems, most prominently networking, tracing, debugging and security. Including to modify the processing of packets in the kernel and also allows the programming of network devices such as SmartNICs. Use cases in eBPF im

                    A Deep Dive into eBPF: Writing an Efficient DNS Monitoring.
                  • Zig言語 : Zig言語に遭遇した時のメモ 2021-12

                    Zig言語 : Zig言語に遭遇した時のメモ 2021-12 はじまり Nim言語の作者がZig言語使って何かやってるというフォーラムの書き込みを見たので Zig言語を調べてみた時のメモ 関連ファイル一式 このページで出てくるソースファイルは以下で取得可能です $ git clone --recursive https://github.com/dinau/zigLearn.git 全てのフォルダにMakefileがあるので$ makeコマンドでビルド可能です zig-0.9.0用です zig-0.14.0-dev...用に修正しました (2024/10) Hello world を実行してみる https://zig-play.dev/ フィボナッチ数列 実際に実行してみる (Runボタンを押す) // zig-0.8.1 2021/12 // fib/src/main.zig cons

                    • Python behind the scenes #12: how async/await works in Python

                      Mark functions as async. Call them with await. All of a sudden, your program becomes asynchronous – it can do useful things while it waits for other things, such as I/O operations, to complete. Code written in the async/await style looks like regular synchronous code but works very differently. To understand how it works, one should be familiar with many non-trivial concepts including concurrency,

                      • Build and deploy ML inference applications from scratch using Amazon SageMaker | Amazon Web Services

                        Artificial Intelligence Build and deploy ML inference applications from scratch using Amazon SageMaker As machine learning (ML) goes mainstream and gains wider adoption, ML-powered inference applications are becoming increasingly common to solve a range of complex business problems. The solution to these complex business problems often requires using multiple ML models and steps. This post shows y

                          Build and deploy ML inference applications from scratch using Amazon SageMaker | Amazon Web Services
                        • Following up on the Python JIT

                          Performance of Python programs has been a major focus of development for the language over the last five years or so; the Faster CPython project has been a big part of that effort. One of its subprojects is to add an experimental just-in-time (JIT) compiler to the language; at last year's PyCon US, project member Brandt Bucher gave an introduction to the copy-and-patch JIT compiler. At PyCon US 20

                          1