Giter VIP home page Giter VIP logo

ammyui's Introduction

Ammy - UI Language for XAML platforms

Ammy is a modern UI language that either replaces or compliments XAML in your projects.

Project site

Documentation

Gitter chat

Roadmap

Main features of Ammy

  • Very simple JSON-like syntax
  • Mixins and aliases to fight copy-pasting and to keep code DRY
  • Inline Binding Converters to avoid implementing IValueConverters for every simple task
  • Runtime Update that actually works (VS2017 has very limited update functionality at the moment)

How Ammy code looks

Window "MyApp.MainWindow" {
  Title: "My first Application"

  Grid {
    TextBlock { "Hello, World!" }
  }
}

Note that you don't need to import any namespaces manually. In case you need to import external namespace, there is C# a using keyword available.

Slightly more complicated example

alias FormField (labelText, binding)
{
  StackPanel {
    Orientation: Horizontal
    
    TextBlock { Text: $labelText }
    TextBlock {
      Text: $binding
    }
  }
}

Window "MyApp.MainWindow" {
  Title: "My First App"
  
  StackPanel { 
    @FormField ("First name", bind FirstName)
    @FormField ("Last name", bind LastName)
    
    TextBlock {
      Text: bind 
            convert (MyViewModel vm) => "Hello, " + vm.FirstName + " " + vm.LastName
    }
  }
}

Building and debugging

  • Install Visual Studio 2017 if you don't have one
  • Install Nemerle (Click "Download Now" button)
  • Clone repository
  • Open Ammy.sln solution in VS2017 and build it
  • Set Ammy.VisualStudio project as StartUp Project and start Debugging session
  • Open Ammy.Tests.sln solution
  • Ammy.Test.Workbench project is for debugging
  • Ammy.Test.Wpf contains permanent tests that should all compile

Project structure

Syntax and AST

Ammy uses Nitra for parsing and typing. First, file is parsed with syntax defined in Syntax.nitra. Resulting ParseTree is then mapped to AST (Mapping.nitra, MappingExpr.nitra, MappingFunctions.nitra).

Semantic analysis is a process where types loaded from Backend are binded to AST. This process defined inside Ast and AstBase projects in .nitra files.

  • Ammy.Backend (Loads referenced assemblies and creates Nitra symbols)
  • Ammy.AstBase (Common AST types)
  • Ammy.Ast (More AST types)
  • Ammy.Syntax (Syntax and Mapping to AST)

Sidekick

Sidekick library has two primary functions. 1) ExpressionConverter used for inline binding converters 2) Runtime update logic

  • Ammy.Sidekick.XamarinForms
  • Ammy.Sidekick.Uwp
  • Ammy.Sidekick.Common

Compilation and Tasks

Build assembly is a glue between IDE/MSBuild and Ammy language.

  • Ammy.Build
  • Ammy.BamlCompilerWPF

IDE

  • Ammy.VisualStudio
  • Ammy.VisualStudio.Service
  • Ammy.VisualStudio.ItemTemplates

Ammy.VisualStudio only contains service providers. These providers use RuntimeLoader to load Ammy.VisualStudio.Service assembly and load actual services. Ammy.VisualStudio.Service contains all the logic for highlighting, intelli-sense, regions, adornments, classisifiers and other stuff.

ammyui's People

Contributors

ionoy avatar

Watchers

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