並び順

ブックマーク数

期間指定

  • から
  • まで

1 - 40 件 / 74件

新着順 人気順

write the syntax for if statement in pythonの検索結果1 - 40 件 / 74件

  • 関数名、メソッド名、変数名でよく使う英単語のまとめ

    プログラミングをしていると関数名、メソッド名、変数名をどうするか悩みます。 ロジックより命名に時間を費やすこともざらにあります。翻訳したり、一般的な命名規則なのかいつも検索して大変です。 よく使うサイトの内容をコピってメモしておく 関数名とメソッド名の違いについて よく使う英単語のまえに、いつもごっちゃにして使っているけど、定義はこんな感じ 「関数」と「メソッド」の違い 似ているところ どちらも何か(引数)を入れると処理をして何か(戻り値)を返してくれます。 違うところ やってること自体は大差ありません。概念としては違います。 メソッドはオブジェクト指向で登場する用語で、オブジェクトの動作を定義したものです。 まずオブジェクトありきなのですね。一方の関数は、オブジェクト云々は関係ありません。 個人的な使い分け Java で登場する関数は「メソッド」です。C 言語で登場する関数は「関数」と呼

      関数名、メソッド名、変数名でよく使う英単語のまとめ
    • REST API Design Best Practices Handbook – How to Build a REST API with JavaScript, Node.js, and Express.js

      By Jean-Marc Möckel I've created and consumed many API's over the past few years. During that time, I've come across good and bad practices and have experienced nasty situations when consuming and building API's. But there also have been great moments. There are helpful articles online which present many best practices, but many of them lack some practicality in my opinion. Knowing the theory with

        REST API Design Best Practices Handbook – How to Build a REST API with JavaScript, Node.js, and Express.js
      • research!rsc: Coroutines for Go

        This post is about why we need a coroutine package for Go, and what it would look like. But first, what are coroutines? Every programmer today is familiar with function calls (subroutines): F calls G, which stops F and runs G. G does its work, potentially calling and waiting for other functions, and eventually returns. When G returns, G is gone and F continues running. In this pattern, only one fu

        • 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

          • Moving off of TypeScript

            We Love You, TypeScriptFor nearly five years now, Motion has operated in a large TypeScript monorepo. At its peak, it was roughly ~2.5 million lines of code after excluding comments, node_modules, etc. To manage this, we used Vercel’s rather excellent Turborepo build system. This is not a blog post hating on TypeScript — quite the opposite! Motion would likely not even have survived until today wi

              Moving off of TypeScript
            • A few words on Ruby's type annotations state

              I don't build systems. I imagine them, then write them. …that were written in a military training camp and accidentally grew to 5k words. I am writing this on my phone, in a barrack that houses some 200+ of my brothers-in-arms in the Ukrainian army’s training camp; I use short periods of rest between training, mostly at night and on Sundays. TBH, since joining the army, I didn’t expect to have tim

              • Weird Lexical Syntax

                I just learned 42 programming languages this month to build a new syntax highlighter for llamafile. I feel like I'm up to my eyeballs in programming languages right now. Now that it's halloween, I thought I'd share some of the spookiest most surprising syntax I've seen. The languages I decided to support are Ada, Assembly, BASIC, C, C#, C++, COBOL, CSS, D, FORTH, FORTRAN, Go, Haskell, HTML, Java,

                  Weird Lexical Syntax
                • 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

                  • Parsing SQL - Strumenta

                    The code for this tutorial is on GitHub: parsing-sql SQL is a language to handle data in a relational database. If you worked with data you have probably worked with SQL. In this article we will talk about parsing SQL. It is in the same league of HTML: maybe you never learned it formally but you kind of know how to use it. That is great because if you know SQL, you know how to handle data. However

                      Parsing SQL - Strumenta
                    • syntaxdesign

                      One of the most recognizable features of a languages is its syntax. What are some of the things about syntax that matter? What questions might you ask if you were creating a syntax for your own language? Motivation A programming language gives us a way structure our thoughts. Each program, has a kind of internal structure, for example: How can we capture this structure? One way is directly, via pi

                      • 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
                        • Font with Built-In Syntax Highlighting

                          Note: I received a lot of great feedback from the discussions at Mastodon and Hacker News, so I've updated the post with some improvements to the font! I've also added some further examples and acknowledgements at the end. Syntax Highlighting in Hand-Coded Websites The problem I have been trying to identify practical reasons why hand-coding websites with HTML and CSS is so hard (by hand-coding, I

                          • 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
                            • New for App Runner – VPC Support | Amazon Web Services

                              AWS News Blog New for App Runner – VPC Support With AWS App Runner, you can quickly deploy web applications and APIs at any scale. You can start with your source code or a container image, and App Runner will fully manage all infrastructure including servers, networking, and load balancing for your application. If you want, App Runner can also configure a deployment pipeline for you. Starting toda

                                New for App Runner – VPC Support | Amazon Web Services
                              • 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

                                • Patterns for Building LLM-based Systems & Products

                                  Patterns for Building LLM-based Systems & Products [ llm engineering production 🔥 ] · 66 min read Discussions on HackerNews, Twitter, and LinkedIn “There is a large class of problems that are easy to imagine and build demos for, but extremely hard to make products out of. For example, self-driving: It’s easy to demo a car self-driving around a block, but making it into a product takes a decade.”

                                    Patterns for Building LLM-based Systems & Products
                                  • Write queries with Gemini assistance  |  BigQuery  |  Google Cloud

                                    Stay organized with collections Save and categorize content based on your preferences. Write queries with Gemini assistance This document describes how to use AI-powered assistance in Gemini in BigQuery to help you query your data with SQL queries and Python code. Gemini in BigQuery can generate and explain queries and code, complete queries and code while you type, and fix code errors. To follow

                                      Write queries with Gemini assistance  |  BigQuery  |  Google Cloud
                                    • 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)
                                        • Phylum Discovers Dozens More PyPI Packages Attempting to Deliver W4SP Stealer in Ongoing Supply-Chain Attack

                                          Phylum Discovers Dozens More PyPI Packages Attempting to Deliver W4SP Stealer in Ongoing Supply-Chain Attack Last week, our automated risk detection platform alerted us to some suspicious activity in dozens of newly published PyPI packages. It appears that these packages are a more sophisticated attempt to deliver the W4SP Stealer on to Python developer’s machines by hiding a malicious __import__

                                            Phylum Discovers Dozens More PyPI Packages Attempting to Deliver W4SP Stealer in Ongoing Supply-Chain Attack
                                          • Zig in 30 minutes

                                            test.md A half-hour to learn Zig This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/ Basics the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with) You'll want to declare a main() function to get

                                              Zig in 30 minutes
                                            • 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
                                                • The Go Programming Language and Environment – Communications of the ACM

                                                  Go is a programming language created at Google in late 2007 and released as open source in November 2009. Since then, it has operated as a public project, with contributions from thousands of individuals and dozens of companies. Go has become a popular language for building cloud infrastructure: Docker, a Linux container manager, and Kubernetes, a container deployment system, are core cloud techno

                                                  • Solving Quantitative Reasoning Problems With Language Models

                                                    Solving Quantitative Reasoning Problems with Language Models Aitor Lewkowycz∗, Anders Andreassen†, David Dohan†, Ethan Dyer†, Henryk Michalewski†, Vinay Ramasesh†, Ambrose Slone, Cem Anil, Imanol Schlag, Theo Gutman-Solo, Yuhuai Wu, Behnam Neyshabur∗, Guy Gur-Ari∗, and Vedant Misra∗ Google Research Abstract Language models have achieved remarkable performance on a wide range of tasks that require

                                                    • A Lisp Interpreter Implemented in Conway’s Game of Life

                                                      Lisp in Life is a Lisp interpreter implemented in Conway’s Game of Life. The entire pattern is viewable on the browser here. To the best of my knowledge, this is the first time a high-level programming language was interpreted in Conway’s Game of Life. Running Lisp on the Game of Life Lisp is a language with a simple and elegant design, having an extensive ability to express sophisticated ideas as

                                                        A Lisp Interpreter Implemented in Conway’s Game of Life
                                                      • Andrej Karpathy — AGI is still a decade away

                                                        The Andrej Karpathy episode. Andrej explains why reinforcement learning is terrible (but everything else is much worse), why model collapse prevents LLMs from learning the way humans do, why AGI will just blend into the previous ~2.5 centuries of 2% GDP growth, why self driving took so long to crack, and what he sees as the future of education. Watch on YouTube; listen on Apple Podcasts or Spotify

                                                          Andrej Karpathy — AGI is still a decade away
                                                        • How to write a linter using tree-sitter in an hour

                                                          This article was discussed on Hacker News. This is a continuation of my last post on how to write a tree-sitter grammar in an afternoon. Building on the grammar we wrote, now we’re going to write a linter for Imp, and it’s even easier! The final result clocks in less than 60 SLOC and can be found here. Recall that tree-sitter is an incremental parser generator. That is, you give it a description o

                                                          • Eliciting Reasoning in Language Models with Cognitive Tools

                                                            arXiv:2506.12115v1 [cs.CL] 13 Jun 2025 Eliciting Reasoning in Language Models with Cognitive Tools Brown Ebouky IBM Research - Zurich ETH Zurich Brown.Ebouky@ibm.com Andrea Bartezzaghi IBM Research - Zurich abt@zurich.ibm.com Mattia Rigotti IBM Research - Zurich mrg@zurich.ibm.com Abstract The recent advent of reasoning models like OpenAI’s o1 was met with excited spec- ulation by the AI community

                                                            • 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

                                                                • Node.js — Node.js v22.7.0 (Current)

                                                                  2024-08-22, Version 22.7.0 (Current), @RafaelGSS Experimental transform types support With the new flag --experimental-transform-types it is possible to enable the transformation of TypeScript-only syntax into JavaScript code. This feature allows Node.js to support TypeScript syntax such as Enum and namespace. Thanks to Marco Ippolito for making this work on #54283. Module syntax detection is now

                                                                    Node.js — Node.js v22.7.0 (Current)
                                                                  • The Birth of UNIX - CoRecursive Podcast

                                                                    When you work on your computer, there are so many things you take for granted: operating systems, programming languages, they all have to come from somewhere. In the late 1960s and 1970s, that somewhere was Bell Labs, and the operating system they were building was UNIX. They were building more than just an operating system though. They were building a way to work with computers that had never exi

                                                                      The Birth of UNIX - CoRecursive Podcast
                                                                    • 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

                                                                        • Emacs Tree-sitter custom highlighting, part 1

                                                                          A few years ago I blogged about custom tree-sitter-based syntax highlighting in emacs. I started out with highlighting certain keywords in red. I wanted to show the keywords that interrupt control flow: Screenshot showing syntax highlighting of keywords in black or red I highlight regular keywords (while, if) in bold. I highlight control flow interrupting keywords (return, continue) in red. That's

                                                                            Emacs Tree-sitter custom highlighting, part 1
                                                                          • Faster virtual machines: Speeding up programming language execution - Mort's Ramblings

                                                                            Date: 2023-01-15 Git: https://gitlab.com/mort96/blog/blob/published/content/00000-home/00015-fast-interpreters.md In this post, I hope to explore how interpreters are often implemented, what a "virtual machine" means in this context, and how to make them faster. Note: This post will contain a lot of C source code. Most of it is fairly simple C which should be easy to follow, but some familiarity w

                                                                            • Databases in 2023: A Year in Review

                                                                              I am starting this new year the same way I ended the last: taking antibiotics because my biological daughter brought home a nasty sinus bug from Carnegie Mellon’s preschool. This was after my first wife betrayed me and gave me COVID. Nevertheless, it is time for my annual screed on last year’s major database happenings and trends since a lot has happened. My goal is to keep my trenchant opinions f

                                                                                Databases in 2023: A Year in Review
                                                                              • Now in Preview – Amazon CodeWhisperer- ML-Powered Coding Companion | Amazon Web Services

                                                                                AWS News Blog Now in Preview – Amazon CodeWhisperer- ML-Powered Coding Companion As I was getting ready to write this post I spent some time thinking about some of the coding tools that I have used over the course of my career. This includes the line-oriented editor that was an intrinsic part of the BASIC interpreter that I used in junior high school, the IBM keypunch that I used when I started co

                                                                                  Now in Preview – Amazon CodeWhisperer- ML-Powered Coding Companion | Amazon Web Services
                                                                                • 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