# compiled language

A programming language usually implemented with a compiler rather than an interpreter.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Using Rust Playground for Hello World and Variable Interpolation

DevFeed: [Using Rust Playground for Hello World and Variable Interpolation](<https://devfeed.tech/articles/using-rust-playground-for-hello-world-and-variable-interpolation-28320.md>)

Original publisher: [Read original article](<http://fuzzyblog.io/blog/rust/2020/03/02/using-rust-playground-for-hello-world-and-variable-interpolation.html>)

Author: Fuzzygroup

Published: 2020-03-02T00:00:00Z

Content type: tutorial

Language: en

Sources: [Scott Johnson](<https://devfeed.tech/sources/scott-johnson.md>)

Topics: [Rust](<https://devfeed.tech/topics/rust.md>), [Code](<https://devfeed.tech/topics/code.md>), [compiled language](<https://devfeed.tech/topics/compiled-language.md>), [Repl.it](<https://devfeed.tech/topics/replit.md>), [browser](<https://devfeed.tech/topics/browser.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [code](<https://devfeed.tech/tags/code.md>), [compiled-language](<https://devfeed.tech/tags/compiled-language.md>), [experiment](<https://devfeed.tech/tags/experiment.md>), [function](<https://devfeed.tech/tags/function.md>), [immutability](<https://devfeed.tech/tags/immutability.md>), [language](<https://devfeed.tech/tags/language.md>), [let](<https://devfeed.tech/tags/let.md>), [playground](<https://devfeed.tech/tags/playground.md>), [program](<https://devfeed.tech/tags/program.md>), [run](<https://devfeed.tech/tags/run.md>), [rust](<https://devfeed.tech/tags/rust.md>), [variables](<https://devfeed.tech/tags/variables.md>)

### AI overview

A beginner-oriented walkthrough of using Rust Playground to run a Hello World program and experiment with variables. It explains Rust syntax such as fn, println!, let, and string interpolation, and briefly compares Rust Playground with Repl.it, including a criticism of Repl.it's paid privacy option.

### Source excerpt

Artwork by my friend Autumn Mott; Hopefully I can find a better link to put here It is a Monday and what better way to start your 6 am Monday morning then learning some of the elements of a new language - Rust. I started by adding a link in my Browser toolbar to the Rust Playground which amounts to a web based REPL (Read Evaluate Print Loop) for Rust where you can type in Rust code and run it. Yes I know it really isn't a REPL because Rust is a compiled language not an interpreted one but it functions well enough as a REPL that I can wrap my Ruby tinged mind around it. Here's the Hello World program that automatically appears in the Rust playground fn main() { println!("Hello, world!"); } The output of this is: Hello, world! That's pretty easy to understand: A main function defined with fn A print line function defined with a ! (my previous Rust reading tells me that's a macro indicator) { and } to denote structure A ; to denote the end of lines I wanted to make a simple change to experiment with the use of variables so I added a main2() function and called it from main(): fn main() { println!("Hello, world!"); main2(); } fn main2() { let x = 5; println!("The value of x is: {}", x); let y = 6; println!("The value of y is: {}", y); } The output of this is: Hello, world! The value of x is: 5 The value of y is: 6 You can see that the let keyword assigns a variable and that {} binds a variable into a string (which is generally called interpolation). Note: Variables quickly bring you in to the heart of Rust - immutability - and here there by dragons that hopefully come up tomorrow after some reading. Link Here's a permanent link to this if you want to try it out. What about Repl.it? Another way to have a web based REPL for Rust is Repl.it. And while I like the concept of repl.it, they have eliminated any privacy without a paid account: Upgrade your account for private repls. This appears on the bottom of every new REPL you create and at $74 / 12 months that feels expensi

## How Python Compiles Source Code to Bytecode for Its Interpreter

DevFeed: [How Python Compiles Source Code to Bytecode for Its Interpreter](<https://devfeed.tech/articles/introduction-to-the-python-interpreter-part-4-it-s-dynamic-29437.md>)

Original publisher: [Read original article](<http://akaptur.github.com/blog/2013/12/03/introduction-to-the-python-interpreter-4/>)

Published: 2013-12-03T19:25:00Z

Content type: article

Language: en

Sources: [Allison Kaptur](<https://devfeed.tech/sources/allison-kaptur.md>)

Topics: [Python](<https://devfeed.tech/topics/python.md>), [Compiler](<https://devfeed.tech/topics/compiler.md>), [compiled language](<https://devfeed.tech/topics/compiled-language.md>), [Code](<https://devfeed.tech/topics/code.md>), [function](<https://devfeed.tech/topics/function.md>)

Tags: [bytecode](<https://devfeed.tech/tags/bytecode.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compiled-language](<https://devfeed.tech/tags/compiled-language.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

This fourth article in a series on the Python interpreter explains how Python can be dynamic while still being compiled. It describes Python's compilation of source code into bytecode for a virtual machine and illustrates the process with a function and its disassembled bytecode.

### Source excerpt

[Edit: A significantly expanded version of this series appears as a chapter in The Architecture of Open Source Applications, volume 4, as A Python Interpreter Written in Python.] This is Part 4 in a series on the Python interpreter. Read Part 1, Part 2, and Part 3. If you're enjoying this series, consider applying to Hacker School, where I work as a facilitator. One of the things I was confused about when I started digging into python internals was how python could be "dynamic" if it was also "compiled." Often, in casual coversation, those two words are used as antonyms - there are "dynamic languages,"1 like Python, Ruby, and Javascript, and "compiled languages," like C, Java, and Haskell. Most of the time, when people talk about a "compiled" language, they mean one that compiles down to native x86/ARM/etc instructions2 - instructions for an actual machine made of metal. An "interpreted" language either doesn't have any compilation at all3, or compiles to an intermediate representation, like bytecode. Bytecode is instructions for a virtual machine, not a piece of hardware. Python falls into this latter category: the Python compiler's job is to generate bytecode for the Python interpreter.4 The Python interpreter's job is to make sense of the bytecode via the virtual machine, which turns out to be a lot of work. We'll dig in to the virtual machine in Part 5. So far our discussion of compiling versus interpretation has been abstract. These ideas become more clear with an example. 1 2 3 4 5 6 7 8 9 10 >>> def modulus(x, y): ... return x % y ... >>> [ord(b) for b in modulus.func_code.co_code] [124, 0, 0, 124, 1, 0, 22, 83] >>> dis.dis(modulus.func_code) 2 0 LOAD_FAST 0 (x) 3 LOAD_FAST 1 (y) 6 BINARY_MODULO 7 RETURN_VALUE Here's a function, its bytecode, and its bytecode run through the disassembler. By the time we get the prompt back after the function definition, the modulus function has been compiled and a code object generated. That code object will never be modified