Giter VIP home page Giter VIP logo

spurv_legacy's Introduction

Spurv

Current Status of this Project

It seems unlikely that development of this project will continue, hence, the repository is renamed to spurv_legacy. The reason is that I will focus on a new (and hopefully better) version of spurv based on a metaprogramming approach.

Introduction

Spurv is a language closely related to Khrono's SPIR-V assembly syntax, but with some changes aimed at making SPIR-V easier to write by hand.

A small comparison to Khrono's specification:

  • Spurv has all the same operations, but with the 'Op'-part taken away, as well as converting all operation keywords from PascalCase to camel_case. Thus, e.g. OpTypePointer becomes type_pointer, but ending capitals are kept, so that e.g. OpGroupIAddNonUniformAMD becomes group_i_add_non_uniform_AMD.
  • All enums have their original form (Shader, Name etc.)
  • Free-form variable names as result id's are supported (all c-like variable names that are not keywords are permitted)
  • Result id's from operations can either be declared as an operand, like it is treated in the physical binary format, or might be assigned with an 'equals' sign, as in Khronos' assembly specification
  • Some common types may be referenced without being explicitly defined beforehand. If e. g. void, float or vec4 is used as a type without being defined, definitions are generated for these on the fly.
  • Some headers for common module types are supported, like FRAGMENT_SHADER and VERTEX_SHADER. See examples for explanations. Attribute definitions must be defined after a header with the #in and #out tags.
  • The implicit types, 'equals'-notation and headers are all optional, and one might write the whole programs with raw SPIR-V grammar (excluding the metadata in the start of a module).

Build

Building on Linux and Windows have these dependencies:

  • CMake
  • Python3
  • Flex
  • Yacc
  • g++ (std C++11)

The building should just be a matter of a normal CMake build:

$ mkdir build
$ cd build
$ cmake ..
$ make

In addition, an example is provided, one that makes use of HConLib's Wingine framework. Thus, this is required for the example ("test"). A small modification of the HCONLIB_ROOT path in the test's Makefile should make everything work when the dependencies are in place.

TODO

  • The language has a large amount of keywords (one for each operation and enum), and might thus be hard to write without triggering a name collision. A grammar file for common editors (primarily Emacs and Vim) could help to avoid this.

Etymology

Spurv means sparrow in Norwegian.

It might be related, idk

spurv_legacy's People

Contributors

thevaffel avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.