Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Open Turing - 20-40% Faster Open Source Version of Turing With New Features
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2, 3, 4, 5  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
trishume




PostPosted: Wed Nov 16, 2011 5:07 pm   Post subject: Open Turing - 20-40% Faster Open Source Version of Turing With New Features

Open Turing - Faster, Open Source Turing

Open Turing is an open-source implementation of Turing for Windows. I (Tristan Hume) acquired the source code from Tom West, the last maintainer of the project. It is backwards-compatible with normal Turing.



I have made some improvements to help adoption. These include speed improvements and 3D support.

Also, most of the icons, images, splash screen etc. have been rebranded.

Partial change log:
-Up to a 40% speed increase. (depends on program)
-Built in hash maps
-Basic OpenGL 3D. Beta, no input.
-Command line invocation with turing.exe -run file.t
-New splash and logo
-Huge speed increases in Pic.ScreenLoad (caching)

How To Get It / Contribute

The project is hosted on Github. On the Github page you can find updated and more complete information.

All documentation on contributing, turing internals and how to use the new features will be on the Github page.


The Github Page (You should go here): https://github.com/Open-Turing-Project/OpenTuring
The Download (For the impatient): https://github.com/downloads/Open-Turing-Project/OpenTuring/package.zip


Posted Image, might have been reduced in size. Click Image to view fullscreen.
Sponsor
Sponsor
Sponsor
sponsor
huskiesgoaler34




PostPosted: Wed Nov 16, 2011 5:21 pm   Post subject: Re: Open Turing - 20-40% Faster Open Source Version of Turing With New Features

Wow! Seems very interesting.
DemonWasp




PostPosted: Wed Nov 16, 2011 5:25 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

I haven't taken a thorough look yet, but this seems to be excellent. Well done!

Although I have to say that I was disappointed when the first file I opened contained:
code:
#include <setjmp.h>


How do I look at the original Turing source code on GitHub?
trishume




PostPosted: Wed Nov 16, 2011 6:21 pm   Post subject: Re: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

DemonWasp @ Wed Nov 16, 2011 5:25 pm wrote:
I haven't taken a thorough look yet, but this seems to be excellent. Well done!

Although I have to say that I was disappointed when the first file I opened contained:
code:
#include <setjmp.h>


How do I look at the original Turing source code on GitHub?


What do you mean by "original"? I haven't made many modifications.

Yes, the code is very old and gives thousands of warnings. At least the code is generally well commented.

Although lots of the code is compiled from Turing Plus into C. Meaning it's garbage and confusing with no comments.
[Gandalf]




PostPosted: Wed Nov 16, 2011 7:02 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

I've been waiting for this moment a long time. Smile Very nice!

Quote:
What do you mean by "original"? I haven't made many modifications.

I assume the initial commit was the source code you got from Tom West? You can find that source tree here.
SNIPERDUDE




PostPosted: Wed Nov 16, 2011 7:45 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

*gasp!* Is that you Gandalf?

Back on topic: I have been waiting for this for so long, I have completely forgotten about it. Tears.
trishume




PostPosted: Wed Nov 16, 2011 8:16 pm   Post subject: Re: Open Turing - 20-40% Faster Open Source Version of Turing With New Features

OOPS! Release Snafu!

One of my friends found a bug in my Pic.ScreenLoad caching implementation. I was using a flawed hash map implementation.

I just switched to a battle-tested hash-map that appears to work.

Anyone who has downloaded it so far must re-download if they want Pic.ScreenLoad to work

The new Pic.ScreenLoad caches loaded files because in my experience beginner turing programmers often using pic.screenload every frame in their games, which is slow.
Caching adds a 10000% speed increase.

Interesting Fact: The 20-40% speed increase in general was caused by me turning on optimization in the compiler. The original guy compiled all previous releases of turing in debug mode. Smile
trishume




PostPosted: Wed Nov 16, 2011 8:32 pm   Post subject: Re: Open Turing - 20-40% Faster Open Source Version of Turing With New Features

Also, I'm not sure that the initial commit is exactly what I got from Tom, but it is close.

Anyway, If you want to help out, fork the development branch and work on things in the issues tab / anything you want. Then submit a pull request.

Github rules!

Also, check out the other things in the Open-Turing-Project organization. Especially: https://github.com/Open-Turing-Project/turing-editor-qt/tree/master/screenshots
Tony




PostPosted: Thu Nov 17, 2011 7:55 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

This codebase is a DailyWTF goldmine.

https://github.com/Open-Turing-Project/OpenTuring/blob/master/turing/src/run.c#L1697
code:

if (((4 == 4) && ((unsigned long) newPC == 0xFFFFFFFF)) || ((4 == 2) && ((unsigned long) newPC == 65535))) {
                            TLEABT((TLint4) 45);
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
2goto1




PostPosted: Thu Nov 17, 2011 8:51 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

A few too many Red Bulls can do that
Zren




PostPosted: Thu Nov 17, 2011 10:18 pm   Post subject: Re: Open Turing - 20-40% Faster Open Source Version of Turing With New Features

Some Examples as I run through this. They're slightly more comprehensive.

Turing:

var map : int := IntHashMap.New ()

put "HashMap id (First Id is 10001)"
put map

put "Insertion"
var input : int := 100
IntHashMap.Put (map, "key", input)

put "Getting a Value from a Key"
var res : int

put "Valid Key (1)"
put IntHashMap.Get (map, "key", res)
put res

put "Invalid Key (0) (result variable is also set to 0)"
put IntHashMap.Get (map, "blah", res)
put res

put "Removing a Key"
IntHashMap.Remove (map, "key")
put IntHashMap.Get (map, "key", res)
put res

IntHashMap.Free (map)

put "Freed HashMap Id: ", map, " (Note it retains the same value)"


map := IntHashMap.New ()
put "Next HashMap Id: ", map, " (After Freeing the first)"


I particularly dislike how it's PicModule like approach. It also makes you limited to 1000 IntHashMaps.
trishume




PostPosted: Thu Nov 17, 2011 10:43 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

Tony that's because everything without an "ed" or "mio" or "mdio" prefix is compiled from Turing Plus into C. Code generated by programs is never pretty. I believe the original turing plus and the compiler have been lost.

In terms of hashmaps that is because the external system does not allow easy OO. I plan on writing an OO wrapper for hashmaps, possibly one that uses #if OPENTURING to fall back on a turing hashmap implementation.

The reason it uses IDs is that it was easy an it prevents people from messing things up. I they were given pointers they could manipulate them and cause segfaults.

I believe that was the original idea for using IDs for pictures and things. If 1000 isn't enough the limit can be changed through some defines, at the cost of more memory usage.
Tony




PostPosted: Thu Nov 17, 2011 10:49 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

I don't approve of the "assign by reference" approach. That is
code:

IntHashMap.Get (map, "key", res)

vs
code:

res = IntHashMap.Get (map, "key")


I think I can live with it returning NULL (that is, 0) on missing keys, especially if
code:

function IntHashMap.containsKey(map, key) : boolean

is added.

I'd want to write code such as
code:

var hashed_strings : array 1..2 of string := init("one", "two")
var map : int := IntHashMap.New()
for i:1..2
  IntHashMap.Put (map, intstr(i), i)
end for

% watch this magic
put "number 2 is: ", hashed_strings(IntHashMap.Get(map, intstr(2)))
%> "number 2 is: two"

In this case NULLs (0s) would just throw array-out-of-bound exceptions. Alternatively I can check for the return value just as well as I would need to check the flag.

I would also accept optional by-reference flag variable, if distinguishing NULLs from legitimate 0s is an absolute must.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Tony




PostPosted: Thu Nov 17, 2011 10:52 pm   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

re: machine generated code

well that puts many parts of the project into a next-to-unmaintainable status, doesn't it?
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
mirhagk




PostPosted: Sat Nov 19, 2011 6:32 am   Post subject: RE:Open Turing - 20-40% Faster Open Source Version of Turing With New Features

Perhaps some one should read through the machine generated code, and try to rewrite/comment it. This project could take off but that section of the code needs to be turned into something that people can actually work on.

I'll try to do this, but I can't guarantee anything for the next week or so.

Also I think perhaps the project should turn into 2 branches. One that is a fully 4.1 compatible compiler, with bug fixes, maybe a few new features, speed improvements etc. I'd also like to see a new version arise that is a breaking update. 4.1 programs may or may not run, but we can get rid of a lot of the stuff we don't like, fix things we thing need fixing etc.

Specifically, the number of images/hashmaps/musicfiles or whatever should never be fixed. Obviously you can't allocate an array of a million for each turing program, but I think that an expanding array of pointers to images would be great, as it could be predefined as 1000, and going over that would just mean that it takes a while to load the 1001st image, which isn't an issue as the loading itself will be MUCH more expensive.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 5  [ 72 Posts ]
Goto page 1, 2, 3, 4, 5  Next
Jump to:   


Style:  
Search: