Git Product home page Git Product logo

doom's Introduction

DOOM.v

DOOM translated from C to V. Builds in 0.7 seconds (x25 speed-up).

Current problems that will be fixed asap:

  • All comments are missing
  • #define consts are replaced with their values
  • No indentation in functions
  • Music works fine, but monster and weapon sounds don't

It is possible to translate files one by one and gradually replace C with V. Object files compiled with V have full binary compatibility with object files produced by C, and can be a drop-in replacement:

# Download and build DOOM
git clone https://github.com/chocolate-doom/chocolate-doom
cd chocolate-doom
cmake .
make chocolate-doom

# Build p_enemy.v and replace the object file
wget https://raw.githubusercontent.com/vlang/doom/master/p_enemy.v
v -lib translated p_enemy.v
cp p_enemy.o src/doom/CMakeFiles/doom.dir/p_enemy.c.o

# Rebuild it again with p_enemy.v.o and launch it
make chocolate-doom && src/chocolate-doom -width 640

There are several things that are allowed in translated code:

  • Globals
  • ++/-- expressions and int to bool conversions (for i-- {)
  • Variables can be unsed
  • Immutability is not enforced

All of these except for the globals are going to be fixed by the translator:

  • ++/-- expressions will be replaced with statements at the right place
  • unused variables will be removed
  • mutable variables will be marked as mutable.

doom's People

Contributors

medvednikov avatar poettlr avatar

Stargazers

 avatar

Watchers

 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.