Giter Site home page Giter Site logo

jonathanvdc / flame Goto Github PK

View Code? Open in Web Editor NEW
52.0 8.0 4.0 105.56 MB

A compiler framework for managed code.

Home Page: https://jonathanvdc.github.io/Flame

License: GNU General Public License v3.0

C# 99.89% Python 0.02% Makefile 0.05% Brainfuck 0.02% Shell 0.02%
programming-language compiler flame

flame's People

Contributors

jonathanvdc 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  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  avatar  avatar

flame's Issues

great work

great work but why not continue the project?

Design: static classes that implement interfaces

Continuing from #26, It seems to me that the obvious way to support interfaces that include static members is like this:

public class Foo : IBar
{
    public static int Bar() { /* implementation */ };
    [CompilerGenerated]
    int IBar.Bar() { return Bar(); };
}

For convertibility to C#, a static class like

public static class Foo : IBar, IBaz
{
    public static int Bar() { /* implementation */ };
    public static int Baz() { /* implementation */ };
}

could be implemented either by removing static, so that a constructor and interfaces are allowed, or by doing this harder thing:

public static class Foo
{
    public static int Bar() { /* implementation */ };
    public static int Baz() { /* implementation */ };
    public static Foo_impl Instance { get { return Foo_impl.Instance; } }
}
public static class Foo_impl : IBar, IBaz
{
    int IBar.Bar() { return Foo.Bar(); };
    int IBaz.Baz() { return Foo.Baz(); };
    private Foo_impl() {}
    // thread races don't seem to matter here
    private static Foo_impl __instance__;
    internal static Foo_impl Instance => __instance__ ??= new Foo_impl();
}

I'm not sure what you meant about lexical macros, but this cannot be done with a lexical macro since the macro can't tell which methods are members of an interface.

Removing static from static class is a problem unfortunately, because C# only allows extension methods in static classes, and there's no logical reason not to allow a static class to contain both extension methods and interface implementations. On the other hand, maybe we could flip it around and move the extension methods to a new class if necessary. In fact, yes, I like it. I've often wanted to define an extension method inside a non-static class and this would be possible like so:

// Enhanced C#
public static class Foo : IBar, IBaz
{
    public static int Bar() { /* implementation */ };
    public static int Baz() { /* implementation */ };
    public static void ExtensionMethod<T>(this T o) { };
}

// Plain C# - note that the class is no longer `static`
public class Foo : IBar, IBaz
{
    public static int Bar() { /* implementation */ };
    public static int Baz() { /* implementation */ };
    public static void ExtensionMethod<T>(T o) { return Foo_ext.ExtensionMethod<T>(o); };

    private Foo() {}
    private static Foo __instance__;
    // Note: I like the name "Singleton" better than "Instance" 
    // unless the latter is already more popular
    public static Foo Instance { get { return __instance__ = __instance__ ?? new Foo(); } }
    int IBar.Bar() { return Bar(); };
    int IBaz.Baz() { return Baz(); };
}
public static class Foo_ext 
{
    public static void ExtensionMethod(this T o) { };
}

Note: I just verified that plain C# allows using static Foo where Foo is not a static class.

So... what's the deal with D#?

I mentioned elsewhere that I didn't think there was much to be gained from making a brand-new programming .NET language because there are already nice alternative .NET languages out there - Nemerle, boo, and so on. For that reason (and because of the lack of documentation) I have to admit that I haven't been paying much attention to D#.

Your readme says it is "roughly speaking - a dialect of C#". I'm not sure what that means. What does that mean? Do you intend backward compatibility with C#? If not, why not? What's the difference? It sure looks like C#...

Loyc += Flame?

So you might have noticed I made an "organization" called loycnet (because some inactive, zero-contribution user is sitting on "loyc"). The ecsharp repo there will become the main one for the source code (and maybe for ecsharp.net too).

And I'm rewriting the front page of loyc.net. I want to make Loyc more inclusive and start building some kind of community, not that I know how to recruit. But an obvious place to start is by listing Flame as a Loyc project on the home page. Does that sound good to you? How would you describe it in one paragraph? I guess Flame doesn't have its own home page, so how about I link to here?

BTW I made a thread for general conversation which we could use to contact each other about minor questions and random thoughts. Care to subscribe/watch it?

backend tutorial

could you make a tutorial how to make a custom backend instead of a custom frontent?

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.