All Projects → dlang-tour → Core

dlang-tour / Core

Licence: bsl-1.0
D Language online tour (https://tour.dlang.org/) and online editor (https://run.dlang.io/)

Programming Languages

language
365 projects
d
599 projects

Projects that are alternatives of or similar to Core

Rakuguide
The Raku Guide
Stars: ✭ 155 (+74.16%)
Mutual labels:  tutorial, guide, introduction
Digital video introduction
A hands-on introduction to video technology: image, video, codec (av1, vp9, h265) and more (ffmpeg encoding).
Stars: ✭ 12,184 (+13589.89%)
Mutual labels:  tutorial, learning, guide
Reactour
Tourist Guide into your React Components
Stars: ✭ 2,782 (+3025.84%)
Mutual labels:  guide, introduction, tour
Showcaseview
🔦The ShowcaseView library is designed to highlight and showcase specific parts of apps to the user with an attractive and flat overlay.
Stars: ✭ 281 (+215.73%)
Mutual labels:  guide, introduction, tour
Pvview
A small library that helps you to make an amazing parallax view
Stars: ✭ 227 (+155.06%)
Mutual labels:  tutorial, guide, introduction
Tutorial Git
📘 어떻게 깃을 사용하는지 빠르게 알아봅시다. (Quick learn How to use Git.)
Stars: ✭ 188 (+111.24%)
Mutual labels:  tutorial, learning, guide
Golang For Nodejs Developers
Examples of Golang compared to Node.js for learning
Stars: ✭ 2,698 (+2931.46%)
Mutual labels:  tutorial, learning, guide
Wasm By Example
Wasm By Example is a website with a set of hands-on introduction examples and tutorials for WebAssembly (Wasm)
Stars: ✭ 226 (+153.93%)
Mutual labels:  tutorial, learning, introduction
Java8 Tutorial
Modern Java - A Guide to Java 8
Stars: ✭ 15,276 (+17064.04%)
Mutual labels:  tutorial, learning, guide
Haskell Study Plan
An opinionated list of resources for learning Haskell
Stars: ✭ 493 (+453.93%)
Mutual labels:  tutorial, learning, guide
Ethereum Development With Go Book
📖 A little book on Ethereum Development with Go (golang)
Stars: ✭ 754 (+747.19%)
Mutual labels:  tutorial, guide
Godot3 procgen demos
Exploring Procedural Generation algorithms in Godot
Stars: ✭ 85 (-4.49%)
Mutual labels:  tutorial, learning
Learn Vim
Learning Vim and Vimscript doesn't have to be hard. This is the guide that you're looking for.
Stars: ✭ 7,221 (+8013.48%)
Mutual labels:  tutorial, learning
Node In Debugging
《Node.js 调试指南》
Stars: ✭ 6,139 (+6797.75%)
Mutual labels:  tutorial, guide
Machinelearningstocks
Using python and scikit-learn to make stock predictions
Stars: ✭ 897 (+907.87%)
Mutual labels:  tutorial, guide
Ko.javascript.info
Modern JavaScript Tutorial in Korean (모던 JavaScript 튜토리얼)
Stars: ✭ 822 (+823.6%)
Mutual labels:  tutorial, learning
Ros Academy For Beginners
中国大学MOOC《机器人操作系统入门》代码示例 ROS tutorial
Stars: ✭ 861 (+867.42%)
Mutual labels:  tutorial, learning
Road To Master Ngrx Store
A curated guided hyperlinks to learn all there is to know of Ngrx/Store and state management in general
Stars: ✭ 15 (-83.15%)
Mutual labels:  tutorial, guide
Awesome Swiftui
A collaborative list of awesome articles, talks, books, videos and code examples about SwiftUI.
Stars: ✭ 878 (+886.52%)
Mutual labels:  tutorial, guide
Pure Bash Bible
📖 A collection of pure bash alternatives to external processes.
Stars: ✭ 28,109 (+31483.15%)
Mutual labels:  learning, guide

The Dlang Online Tour

Build Status

This is the D language online tour which provides an online introduction to this great system programming language with examples that can be edited, compiled and run online.

The most recent version of this tour can be seen here: http://tour.dlang.org.

Running offline

The tour can be downloaded for offline access:

git clone --recursive https://github.com/dlang-tour/core && cd core
git submodule foreach git pull origin master
dub

This requires DUB - D's package manager. DUB is part of the release installer and archives.

Specifying a language directory

For translator it's often convenient to clone their directory and run the tour only with their language. A custom language can be loaded directly using the -l / --lang-dir option with the path to the directoy of the to be loaded language:

dub fetch dlang-tour # only once
dub run dlang-tour -- --lang-dir .

Add Content

This repository contains the application that runs the tour. Please refer to english content or another language.

Further information on how to add or change existing content can also be found in the CONTRIBUTING.md.

Compile & Run

On a minimal Ubuntu system the following command will install the system packages needed to run all examples:

apt update && apt install \
    curl xz-utils unzip gnupg `# Needed for the install.sh script` \
    build-essential `# C toolchain for compiling and linking` \
    libssl-dev libevent-dev `# Vibe-d network dependencies`\
    libopenblas-dev `# lubeck computer library dependency` \
    libxml++2.6-2v5 zlib1g-dev `# LDC dependencies`

Make sure dub is installed and simply run dub in the dlang-tour folder:

git clone --recursive https://github.com/dlang-tour/core && cd core
dub

You might want to change the settings in config.yml to change the ports the tour is listening to.

OpenSSL 1.1

If you see linker errors regarding OpenSSL/1.1, try:

dub --override-config="vibe-d:tls/openssl-1.1"

Compiling & running of user source code

The source code on the tour can be compiled and then executed online and its output returned to the user. Therefore three different types of execution drivers have been implemented within the dlang-tour:

  • off: no online compilation allowed. If the user hits Runs an error message will be returned.
  • stupidlocal: an unsafe method that just runs rdmd on the local host system and returns its output. Very unsafe and musn't ever be used in production!
  • docker: runs dmd within a special Docker container (core-exec) and returns its output. The driver imposes the Docker container memory and execution time limits. Additional configurations options available in config.yml.

The execution driver is set in config.yml.

Caching of the program output can also be enabled in config.yml (exec.cache = true). Caching will only be enabled for the built-in default examples however.

Docker image

A Docker image is automatically built by Travis CI and pushed to the repository at https://hub.docker.com/r/dlangtour/core. The Dlang-Tour Docker container is configured to use Docker itself to compile and run D source code in the online editor. For that to work the host system's Docker /var/run/docker.sock Unix domain socket has to be mounted to work inside the container. A sandbox for compiling will then be started on the host system actually, and not within the DLang Tour Docker container itself.

The code for running the D compilers in a Docker sandbox can be found here: core-exec.

So to run the latest dlang-tour version in a Docker container, run the following command:

docker run -d --rm -p 80:8080 -e GOOGLE_ANALYTICS_ID=123 -v /var/run/docker.sock:/var/run/docker.sock \
	--name dlang-tour dlangtour/core

The tour will be available at your host system on port 80. To stop the container again just run:

docker stop dlang-tour

For further Docker foo please refer to the Docker documentation.

Note: The docker version inside the container must be compatible to that on the host system! Generally a newer version might run on the host system than within the container.

The Docker container is also the suggested way of dlang-tour's deployment.

Dlang Tour Bot

There is a friendly bot in place that listens to the events of all language repositories and triggers rebuilds and thus automatic deploments on a new change. More information about it can be found at it's repository.

Environment variables

GOOGLE_ANALYTICS_ID

default: (empty)

To enable Google Analytics please specify the environment variable GOOGLE_ANALYTICS_ID and set it to the tracking ID provided for your Analytics account.

GITHUB_TOKEN

default: (empty)

Required for exporting Gists to GitHub. Follow these instrutions to generate a CLI GitHub token.

EXEC_DOCKER_MEMORY_LIMIT

default: 256

Memory limit per started rdmd Docker container which compiles and runs the user code.

EXEC_DOCKER_MAX_QUEUE_SIZE

default: 10

Maximum number of parallel executions of the rdmd user code Docker container.

EXEC_DOCKER_TIME_LIMIT

default: 20

Time limit in seconds the rdmd Docker container with the user code is allowed to take until it is killed.

EXEC_DOCKER_MAX_OUTPUT_SIZE

default: 4096

Maximum allowed size in bytes of the generated user program's output.

Deployment

A deployment guide can be found in the deploy folder.

License

Boost License. See LICENSE.txt for more details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].