並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 29 件 / 29件

新着順 人気順

python inline if statement syntaxの検索結果1 - 29 件 / 29件

  • 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

    • Python 3.10から導入されたBetter error messagesの深掘り | gihyo.jp

      鈴木たかのりです。今月のPython Monthly Topicsでは、Python 3.10から導入されたBetter error messagesについて紹介します。Better error messagesがどういったものであるかの紹介と、どのようにこのエラーメッセージが出力されているか、Python内部の処理についても触れようと思います。 Better error messagesとは Python 3.10からBetter error messagesという機能が追加されました。この機能は名前のとおり「エラーメッセージを改善」するものです。「⁠エラーメッセージの改善」により以前よりもわかりやすいエラーメッセージが出力され、ユーザーがエラーの意味に気づきやすくなりました。 例として、以下のようなリストの閉じカッコ(])を忘れたコードを実行し、出力されるエラーメッセージを見比べてみま

        Python 3.10から導入されたBetter error messagesの深掘り | gihyo.jp
      • Rewriting the Ruby parser

        At Shopify, we have spent the last year writing a new Ruby parser, which we’ve called YARP (Yet Another Ruby Parser). As of the date of this post, YARP can parse a semantically equivalent syntax tree to Ruby 3.3 on every Ruby file in Shopify’s main codebase, GitHub’s main codebase, CRuby, and the 100 most popular gems downloaded from rubygems.org. We recently got approval to merge this work into C

          Rewriting the Ruby parser
        • AST vs. Bytecode: Interpreters in the Age of Meta-Compilation

          233 AST vs. Bytecode: Interpreters in the Age of Meta-Compilation OCTAVE LAROSE, University of Kent, UK SOPHIE KALEBA, University of Kent, UK HUMPHREY BURCHELL, University of Kent, UK STEFAN MARR, University of Kent, UK Thanks to partial evaluation and meta-tracing, it became practical to build language implementations that reach state-of-the-art peak performance by implementing only an interprete

          • April 2022 (version 1.67)

            Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.67.1: The update addresses this security issue. Update 1.67.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the April 2022 release of Visual Studio Code. There are many updates in this version that we hope

              April 2022 (version 1.67)
            • Kalyn: a self-hosting compiler for x86-64

              Over the course of my Spring 2020 semester at Harvey Mudd College, I developed a self-hosting compiler entirely from scratch. This article walks through many interesting parts of the project. It’s laid out so you can just read from beginning to end, but if you’re more interested in a particular topic, feel free to jump there. Or, take a look at the project on GitHub. Table of contents What the pro

              • February 2021 (version 1.54)

                Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.54.1: The update addresses an issue with an extension dependency. Update 1.54.2: The update addresses these issues. Update 1.54.3: The update addresses this issue. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the February 2021 release of Vi

                  February 2021 (version 1.54)
                • 0.8.0 Release Notes ⚡ The Zig Programming Language

                  Tier 4 Support § Support for these targets is entirely experimental. If this target is provided by LLVM, LLVM may have the target as an experimental target, which means that you need to use Zig-provided binaries for the target to be available, or build LLVM from source with special configure flags. zig targets will display the target if it is available. This target may be considered deprecated by

                  • January 2025 (version 1.97)

                    Update 1.97.1: The update addresses these security issues. Update 1.97.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the January 2025 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some of the key highlights include: Next Edit Suggestions (preview) - Co

                      January 2025 (version 1.97)
                    • Why People are Angry over Go 1.23 Iterators - gingerBill

                      NOTE: This is based on, but completely rewritten, from a Twitter post: https://x.com/TheGingerBill/status/1802645945642799423 TL;DR It makes Go feel too “functional” rather than being an unabashed imperative language. I recently saw a post on Twitter showing the upcoming Go iterator design for Go 1.23 (August 2024). From what I can gather, many people seem to dislike the design. I wanted to give m

                      • Lean for JavaScript Developers — overreacted

                        Lean for JavaScript DevelopersSeptember 2, 2025 This is my opinionated syntax primer for the Lean programming language. It is far from complete and may contain inaccuracies (I’m still learning Lean myself) but this is how I wish I was introduced to it, and what I wish was clarified. Why Lean? This post assumes you’re already eager to learn a bit of Lean. For motivation, I humbly submit to you two

                          Lean for JavaScript Developers — overreacted
                        • Rust 1.53を早めに深掘り - OPTiM TECH BLOG

                          こんにちは、R&Dチームの齋藤(@aznhe21)です。 今日はオプティムの創立記念パーティーがオンラインで行われます。 オプティムは2000/6/8に設立され、去年は20周年の節目であったにも関わらず生憎の時制で大きく祝えませんでしたが、 今年は準備も万全、盛大にお祝いしたいと思います。 さて、本日、日本時間6/18(金)、Rust 1.53がリリースされました。 この記事ではRust 1.53での変更点を詳しく紹介します。 6/18は京大の前身・京都帝国大学創立の日 ピックアップ 識別子にASCII以外の文字も使えるようになった ORパターンが使えるようになった 配列にIntoIteratorが実装された 安定化されたAPIのドキュメント AtomicBool::fetch_update サンプル AtomicPtr::fetch_update サンプル BTreeMap::retai

                            Rust 1.53を早めに深掘り - OPTiM TECH BLOG
                          • 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
                            • Sayonara, C++, and hello to Rust!

                              This past May, I started a new job working in Rust. I was somewhat skeptical of Rust for a while, but it turns out, it really is all it’s cracked up to be. As a long-time C++ programmer, and C++ instructor, I am convinced that Rust is better than C++ in all of C++’s application space, that for any new programming project where C++ would make sense as the programming language, Rust would make more

                              • PEP 8 – Style Guide for Python Code | peps.python.org

                                PEP 8 – Style Guide for Python Code Author: Guido van Rossum <guido at python.org>, Barry Warsaw <barry at python.org>, Alyssa Coghlan <ncoghlan at gmail.com> Status: Active Type: Process Created: 05-Jul-2001 Post-History: 05-Jul-2001, 01-Aug-2013 Table of Contents Introduction A Foolish Consistency is the Hobgoblin of Little Minds Code Lay-out Indentation Tabs or Spaces? Maximum Line Length Shoul

                                  PEP 8 – Style Guide for Python Code | peps.python.org
                                • What's New in Emacs 28.1?

                                  Try Mastering Emacs for free! Are you struggling with the basics? Have you mastered movement and editing yet? When you have read Mastering Emacs you will understand Emacs. It’s that time again: there’s a new major version of Emacs and, with it, a treasure trove of new features and changes. Notable features include the formal inclusion of native compilation, a technique that will greatly speed up y

                                  • Type Parameters Proposal

                                    Ian Lance Taylor Robert Griesemer August 20, 2021 StatusThis is the design for adding generic programming using type parameters to the Go language. This design has been proposed and accepted as a future language change. We currently expect that this change will be available in the Go 1.18 release in early 2022. AbstractWe suggest extending the Go language to add optional type parameters to type an

                                    • A string formatting library in 65 lines of C++

                                      In this write-up, I will walk you through an implementation of a string formatting library for C++ I came up with for my video game. The end result came out really compact, at only 65 lines of code—providing a skeleton that can be supplemented with additional functionality at low cost. Usage Given a format buffer… char buffer[64]; String_Buffer buf = {str, sizeof str}; …the fmt::format function pr

                                      • Gregory Szorc's Digital Home | Rust is for Professionals

                                        A professional programmer delivers value through the authoring and maintaining of software that solves problems. (There are other important ways for professional programmers to deliver value but this post is about programming.) Programmers rely on various tools to author software. Arguably the most important and consequential choice of tool is the programming language. In this post, I will articul

                                        • Plan 9 Desktop Guide

                                          PLAN 9 DESKTOP GUIDE INDEX What is Plan 9? Limitations and Workarounds Connecting to Other Systems VNC RDP SSH 9P Other methods Porting Applications Emulating other Operating Systems Virtualizing other Operating Systems Basics Window Management Copy Pasting Essential Programs Manipulating Text in the Terminal Acme - The Do It All Application Multiple Workspaces Tiling Windows Plumbing System Admin

                                          • April 2021 (version 1.56)

                                            Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.56.1: The update addresses these security issues. Update 1.56.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the April 2021 release of Visual Studio Code. The VS Code team has been busy this month working

                                              April 2021 (version 1.56)
                                            • Ubuntu 24.04 LTS (Noble Numbat) Release Notes

                                              Noble Numbat Release Notes Table of Contents Introduction New features in 24.04 LTS Known Issues Official flavours More information Introduction These release notes for Ubuntu 24.04 LTS (Noble Numbat) provide an overview of the release and document the known issues with Ubuntu and its flavours. For details of the changes applied since 24.04, please see the 24.04.2 change summary. Support lifespan

                                              • A Review of Nim 2: The Good & Bad with Example Code

                                                I've been using Nim for about 1-2 years now, and I believe the language is undervalued. It's not perfect, of course, but it's pleasant to write and read. My personal website uses Nim. After reading a recent article on Nim ("Why Nim") and the associated HN comments, it's clear that comments and some information about Nim are misleading and outdated. Since Nim 2, a tracing Garbage Collector is not t

                                                • JupyterLab Changelog — JupyterLab 4.5.0a3 documentation

                                                  JupyterLab Changelog# v4.4# JupyterLab 4.4 includes a number of new features (described below), bug fixes, and enhancements. This release is compatible with extensions supporting JupyterLab 4.0. Extension authors are encouraged to consult the Extension Migration Guide which lists deprecations and changes to the public API. Code console improvements# The code console prompt can now be positioned on

                                                  • HTML Whitespace is Broken - Devel without a Cause

                                                    HTML Whitespace is Broken September 2, 2024Recently, I was working on a project which required a deeper understanding of how whitespace works in HTML. I was never a fan of HTML's whitespace behavior before as I've been burned by it a few times. But as I dug into it more deeply, I found myself discovering complex design issues that I wanted to explore in a blog post. This is partially to write down

                                                      HTML Whitespace is Broken - Devel without a Cause
                                                    • June 2025 (version 1.102)

                                                      Release date: July 9, 2025 Update 1.102.1: The update addresses these issues. Update 1.102.2: The update addresses these issues. Update 1.102.3: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the June 2025 release of Visual Studio Code. There are many updates in this version that we hope you'll like, some

                                                        June 2025 (version 1.102)
                                                      • January 2022 (version 1.64)

                                                        Join a VS Code Dev Days event near you to learn about AI-assisted development in VS Code. Update 1.64.1: The update addresses these security issues. Update 1.64.2: The update addresses these issues. Downloads: Windows: x64 Arm64 | Mac: Universal Intel silicon | Linux: deb rpm tarball Arm snap Welcome to the January 2022 release of Visual Studio Code. There are many updates in this version that we

                                                          January 2022 (version 1.64)
                                                        • Sketch of a Post-ORM

                                                          I’ve been writing a lot of database access code as of late. It’s frustrating that in 2023, my choices are still to either write all of the boilerplate by hand, or hand all database access over to some inscrutable “agile” ORM that will become a crippling liability in the 2-3y timescale. This post is about how I want to use databases, from the perspective of an application server developer—not a DBA

                                                            Sketch of a Post-ORM
                                                          • Writing Truly Memory Safe JIT Compilers

                                                            Last month the V8 team published an excellent blog post on what they call the V8 Sandbox. This isn’t a sandbox for your JavaScript code — it’s intended to mitigate browser exploits caused by bugs in the JIT compiler itself. That’s important work because they report that most Chrome exploits start with a V8 memory safety bug. V8 is written in C++, so it may seem like these are the sort of bugs you’

                                                              Writing Truly Memory Safe JIT Compilers
                                                            1