Giter Club home page Giter Club logo

rogue's Introduction

About Me

TODO

rogue's People

Contributors

abepralle avatar belock-c avatar brombres avatar murphymc avatar sabont avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

rogue's Issues

multiple definition of create_thread()

If you compile with pthreads enabled and then use the generated header in another file (e.g., to interface with some hand-written C++), you get a link error because of multiple definitions of create_thread(), which comes from Thread.rogue:
https://github.com/AbePralle/Rogue/blob/develop/Source/Libraries/Standard/Thread.rogue#L192

The problem is that Thread.rogue puts its create_thread() helper function into the header via a nativeHeader block.

Two possible fixes:

  • Put a prototype for create_thread() into the header instead of the whole function, and then put the actual function in a nativeCode block
  • I think we can probably just make the function static; this should probably be fine in general because it's not like the function does much; this seem to be the approach taken with many other functions in Thread.rogue... maybe create_thread() just got missed

Whichever road we go, I think there may be another function or two that it should also be applied to.

Routines aren't super easy to call from C/C++

A long while ago, I think I either suggested or changed the code for routines so that they're methods on Global. A downside here is that from a C perspective, they take a reference to the Global singleton, which makes them harder to call from C/C++.

Probably lots of ways to fix which don't really cost anything.

File permissions problem don't result in errors

Try compiling some Rogue code into a directory for which you don't have permissions. It says, e.g., that it wrote the .cpp, but there's no .cpp. I'd guess the same thing happens if you just open a file and try writing into it. Not sure what the exact best behavior here is. Probably just an exception when attempting to open the file. But almost surely it's not just silent failure.

I can take a look at this in a week or two if I'm not beaten to it.

boehm-typed GC mode doesn't used typed memory

There's an issue with the boehm-typed GC mode.

Abe pointed out that CPPWriter writes what should be the gc_alloc_type field, but that NativeCPP.cpp never reads it.

This looks like I just forgot to commit the relevant line.

As far as boehm-typed goes, I think things should still "work"... it just always falls back to gc_alloc_type 0, which should generally/always be okay. So you don't get any typing, and it ends up basically like the normal boehm mode.

But it seems like this will throw off where the introspection data is, and NativeCPP will get it wrong which could lead to very bad things when trying to use introspection on code built for boehm-typed.

The fix should be as simple as reading into gc_alloc_type in NativeCPP.cpp at the proper place #if ROGUE_GC_MODE_BOEHM_TYPED.

Consider initializing properties of default compounds

If a compound XYZ has this property definition:

PROPERTIES
  z = 1 : Int32

Then z will be initialized to 1 in these lines:

PROPERTIES
  point = XYZ()
...
local point = XYZ()

but not in these lines:

PROPERTIES
  point : XYZ
...
local point : XYZ

Consider initializing compounds as default locals, properties, and global properties. There are two different mechanisms that would need to be changed.

  1. Adding the initializations to the default constructor of the C++ struct should take care of local and global property declarations.

  2. Because objects start out as a zeroed chunk of memory that is cast to a C++ struct on property access, here we need to modify each class's init_object() method to explicitly set each property compound to a new default struct.

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.