Odin - a fast, concise, readable, and pragmatic programming language

栏目: IT技术 · 发布时间: 4年前

内容简介:The Odin programming language is fast, concise, readable, pragmatic and open sourced. It is designed with the intent of replacing C with the following goals:Website:Instructions for downloading and install the Odin compiler and libraries.
Odin - a fast, concise, readable, and pragmatic programming language

A fast, concise, readable, pragmatic and open sourced programming language.

The Odin Programming Language

The Odin programming language is fast, concise, readable, pragmatic and open sourced. It is designed with the intent of replacing C with the following goals:

  • simplicity
  • high performance
  • built for modern systems
  • joy of programming

Website: https://odin-lang.org/

package main

import "core:fmt"

main :: proc() {
	program := "+ + * :smiley: - /";
	accumulator := 0;

	for token in program {
		switch token {
		case '+': accumulator += 1;
		case '-': accumulator -= 1;
		case '*': accumulator *= 2;
		case '/': accumulator /= 2;
		case ':smiley:': accumulator *= accumulator;
		case: // Ignore everything else
		}
	}

	fmt.printf("The program \"%s\" calculates the value %d\n",
	           program, accumulator);
}

Documentation

Getting Started

Instructions for downloading and install the Odin compiler and libraries.

Learning Odin

Overview of Odin

An overview of the Odin programming language.

Frequently Asked Questions (FAQ)

Answers to common questions about Odin.

The Odin Wiki

A wiki maintained by the Odin community.

Odin Discord

Get live support and talk with other odiners on the Odin Discord.

References

Language Specification

The official Odin Language specification.

Articles

The Odin Blog

The official blog of the Odin programming language, featuring announcements, news, and in-depth articles by the Odin team and guests.

Setup

Odin only supports x86-64 at the moment (64-bit), relies on LLVM for code generation and an external linker.

In addition, the following platform-specific steps are necessary:

  • Windows

    • Have Visual Studio installed (MSVC 2010 or later, for the linker)
    • Have a copy of opt.exe and llc.exe in Odin/bin . Pre-built Windows binaries can be found here and must be explicitly copied
    • Open a valid command prompt:
      • Basic: run the x64 Native Tools Command Prompt for VS2017 shortcut bundled with VS 2017, or
      • Advanced: run vcvarsall.bat x64 from a blank cmd session
  • MacOS

    brew install llvm
    $PATH
    
  • GNU/Linux

    $PATH
    

Then build the compiler by calling build.bat (Windows) or make (Linux/MacOS). This will automatically run the demo program if successful.

Notes for Linux:: The compiler currently relies on the core and shared library collection being relative to the compiler executable. Installing the compiler in the usual sense (to /usr/local/bin or similar) is therefore not as straight forward as you need to make sure the mentioned libraries are available. As a result, it is recommended to simply explicitly invoke the compiler with /path/to/odin in your preferred build system, or add /path/to/odin to $PATH .

Please read the Getting Started Guide for more information.

Requirements to build and run

Please read the Getting Started Guide .

  • Windows

    • x86-64
    • MSVC 2010 installed (C++11 support)
    • LLVM binaries for opt.exe , llc.exe , and lld-link.exe
    • Requires MSVC's link.exe as the linker
      • run vcvarsall.bat to setup the path
  • MacOS

    brew install llvm
    
  • GNU/Linux

    • x86-64
    • Build tools (ld)
    • LLVM installed
    • Clang installed (temporary - this is Calling the linker for now)

Warnings

  • This is still highly in development and the language's design is quite volatile.
  • Syntax is not fixed.

Demonstrations:


以上所述就是小编给大家介绍的《Odin - a fast, concise, readable, and pragmatic programming language》,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对 码农网 的支持!

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

A Philosophy of Software Design

A Philosophy of Software Design

John Ousterhout / Yaknyam Press / 2018-4-6 / GBP 14.21

This book addresses the topic of software design: how to decompose complex software systems into modules (such as classes and methods) that can be implemented relatively independently. The book first ......一起来看看 《A Philosophy of Software Design》 这本书的介绍吧!

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

SHA 加密
SHA 加密

SHA 加密工具

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器