tonyheupel / hyperjs Goto Github PK
View Code? Open in Web Editor NEWJavaScript-style coding within C#
Home Page: http://blog.tonyheupel.com
License: Other
JavaScript-style coding within C#
Home Page: http://blog.tonyheupel.com
License: Other
HyperJS - JavaScript in C# Project initiated by Tony Heupel (pronounced "High-pull") =========================== Copyright 2010 (C) Tony Heupel Contents: HyperJS - a.k.a. JS.cs: JavaScript-like programming in C# using closures and dynamics. This is a lame attempt at creating JavaScript in C# just to see how the HyperHypo class holds up to being similar to JavaScript style in C#; not necessarily because it's a good idea to write C# in JavaScript--because it's not... That being said, it's just a fun weekend project for me right now and is stretching my brain and expanding my knowlege of JavaScript and C# 4.0. Boolean is the only thing that actually resembles JavaScript (and has unit tests), but it uses C# constructs to do it. I suspect that once I get Object.valueOf and the other core JavaScript conversions in place, it will look nothing like it does now; but at least I have tests to prove it! This is based on my HyperCore libraries with HyperDictionary (dictionary implementation with prototype-style "inhertance") and HyperHypo (dynamic C# class that support JavaScript-style prototype inheritance using a HyperDictionary as the Member Provider. Hyper - "More than" C# Hypo - "Less than" JavaScript. HyperJS.UnitTest: Unit test that cover HyperJS implementations.
This, along with implementation of valueOf and toString will make EVERYTHING easier. Even the current Boolean function should just follow the standard JS type conversion of valueOf then toString, etc.
Relying on native .NET types is screwing with things like feature detection and treating functions as first-class citizens. We simply need to be able to box everything in terms of Object or Function, I think.
Maybe use param[] args to simulate javascript "args" that is passed to each function when defined inside a method. Issues around things being positional instead of key/value pairs potentially...maybe use a hash/dictionary if that works.
I think we want to avoid optional parameters. Maybe use overloads for Intellisense niceness when defining non-dynamic versions of the function definitions and ensure proper args parameter position in there?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.