diff --git a/.github/workflows/build-jekyll.yml b/.github/workflows/build-jekyll.yml deleted file mode 100644 index 48cb2c7..0000000 --- a/.github/workflows/build-jekyll.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build and Deploy to Github Pages - -on: - push: - branches: - - main - -jobs: - build_and_deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - # Use GitHub Actions' cache to cache dependencies on servers - - uses: actions/cache@v2 - with: - path: vendor/bundle - key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }} - restore-keys: | - ${{ runner.os }}-gems- - - # Use GitHub Deploy Action to build and deploy to Github - - uses: jeffreytse/jekyll-deploy-action@v0.3.1 - with: - provider: 'github' - token: ${{ secrets.GITHUB_TOKEN }} # It's your Personal Access Token(PAT) - repository: '' # Default is current repository - branch: 'gh-pages' # Default is gh-pages for github provider - jekyll_src: './' # Default is root directory - jekyll_cfg: '_config.yml' # Default is _config.yml - jekyll_baseurl: '' # Default is according to _config.yml - bundler_ver: '>=0' # Default is latest bundler version - cname: '' # Default is to not use a cname - actor: '' # Default is the GITHUB_ACTOR - pre_build_commands: '' # Installing additional dependencies (Arch Linux) diff --git a/.gitignore b/.gitignore deleted file mode 100644 index d4a0870..0000000 --- a/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -_site/ -.sass-cache/ -.jekyll-cache/ -.jekyll-metadata -.bundle/ -vendor/ -thumbs/ diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/Gemfile b/Gemfile deleted file mode 100644 index 961ee30..0000000 --- a/Gemfile +++ /dev/null @@ -1,33 +0,0 @@ -source "https://rubygems.org" -# Hello! This is where you manage which Jekyll version is used to run. -# When you want to use a different version, change it below, save the -# file and run `bundle install`. Run Jekyll with `bundle exec`, like so: -# -# bundle exec jekyll serve -# -# This will help ensure the proper Jekyll version is running. -# Happy Jekylling! -gem "jekyll", "~> 4.0.0" -# This is the default theme for new Jekyll sites. You may change this to anything you like. -# If you want to use GitHub Pages, remove the "gem "jekyll"" above and -# uncomment the line below. To upgrade, run `bundle update github-pages`. -# gem "github-pages", group: :jekyll_plugins -# If you have any plugins, put them here! -group :jekyll_plugins do - gem "jekyll-feed", "~> 0.12" - gem "jekyll-paginate" - gem "jekyll-sitemap" -end - -# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem -# and associated library. -install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do - gem "tzinfo", "~> 1.2" - gem "tzinfo-data" -end - -# Performance-booster for watching directories on Windows -gem "wdm", "~> 0.1.1", :install_if => Gem.win_platform? -gem "mini_magick" - -gem "webrick", "~> 1.7" diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100644 index 8db4300..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,88 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) - colorator (1.1.0) - concurrent-ruby (1.1.9) - em-websocket (0.5.3) - eventmachine (>= 0.12.9) - http_parser.rb (~> 0) - eventmachine (1.2.7) - ffi (1.15.5) - forwardable-extended (2.6.0) - http_parser.rb (0.8.0) - i18n (1.8.11) - concurrent-ruby (~> 1.0) - jekyll (4.0.1) - addressable (~> 2.4) - colorator (~> 1.0) - em-websocket (~> 0.5) - i18n (>= 0.9.5, < 2) - jekyll-sass-converter (~> 2.0) - jekyll-watch (~> 2.0) - kramdown (~> 2.1) - kramdown-parser-gfm (~> 1.0) - liquid (~> 4.0) - mercenary (~> 0.3.3) - pathutil (~> 0.9) - rouge (~> 3.0) - safe_yaml (~> 1.0) - terminal-table (~> 1.8) - jekyll-feed (0.16.0) - jekyll (>= 3.7, < 5.0) - jekyll-paginate (1.1.0) - jekyll-sass-converter (2.1.0) - sassc (> 2.0.1, < 3.0) - jekyll-sitemap (1.4.0) - jekyll (>= 3.7, < 5.0) - jekyll-watch (2.2.1) - listen (~> 3.0) - kramdown (2.3.1) - rexml - kramdown-parser-gfm (1.1.0) - kramdown (~> 2.0) - liquid (4.0.3) - listen (3.7.1) - rb-fsevent (~> 0.10, >= 0.10.3) - rb-inotify (~> 0.9, >= 0.9.10) - mercenary (0.3.6) - mini_magick (4.11.0) - pathutil (0.16.2) - forwardable-extended (~> 2.6) - public_suffix (4.0.6) - rb-fsevent (0.11.0) - rb-inotify (0.10.1) - ffi (~> 1.0) - rexml (3.2.5) - rouge (3.27.0) - safe_yaml (1.0.5) - sassc (2.4.0) - ffi (~> 1.9) - terminal-table (1.8.0) - unicode-display_width (~> 1.1, >= 1.1.1) - thread_safe (0.3.6) - tzinfo (1.2.9) - thread_safe (~> 0.1) - tzinfo-data (1.2021.5) - tzinfo (>= 1.0.0) - unicode-display_width (1.8.0) - wdm (0.1.1) - webrick (1.7.0) - -PLATFORMS - ruby - -DEPENDENCIES - jekyll (~> 4.0.0) - jekyll-feed (~> 0.12) - jekyll-paginate - jekyll-sitemap - mini_magick - tzinfo (~> 1.2) - tzinfo-data - wdm (~> 0.1.1) - webrick (~> 1.7) - -BUNDLED WITH - 2.2.22 diff --git a/README.md b/README.md deleted file mode 100644 index d9e5340..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -This is the repository for the WattleScript website. For edits open a PR against `main` as the gh-pages branch is autogenerated by CI. diff --git a/_config.yml b/_config.yml deleted file mode 100644 index f7f81dd..0000000 --- a/_config.yml +++ /dev/null @@ -1,55 +0,0 @@ -# Welcome to Jekyll! -# -# This config file is meant for settings that affect your whole blog, values -# which you are expected to set up once and rarely edit after that. If you find -# yourself editing this file very often, consider using Jekyll's data files -# feature for the data you need to update frequently. -# -# For technical reasons, this file is *NOT* reloaded automatically when you use -# 'bundle exec jekyll serve'. If you change this file, please restart the server process. -# -# If you need help with YAML syntax, here are some quick references for you: -# https://learn-the-web.algonquindesign.ca/topics/markdown-yaml-cheat-sheet/#yaml -# https://learnxinyminutes.com/docs/yaml/ -# -# Site settings -# These are used to personalize your new site. If you look in the HTML files, -# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. -# You can create any custom variable you would like, and they will be accessible -# in the templates via {{ site.myvariable }}. - -title: WattleScript -email: -description: >- # this means to ignore newlines until "baseurl:" - WattleScript -baseurl: "" # the subpath of your site, e.g. /blog -url: "https://wattlescript.github.io" # the base hostname & protocol for your site, e.g. http://example.com -# paginate: 5 -# paginate_path: "/blog/page:num/" -# Build settings -plugins: - - jekyll-feed - - jekyll-paginate - - jekyll-sitemap - -# Exclude from processing. -# The following items will not be processed, by default. -# Any item listed under the `exclude:` key here will be automatically added to -# the internal "default list". -# -# Excluded items can be processed by explicitly listing the directories or -# their entries' file path in the `include:` list. -# -exclude: - - .sass-cache/ - - .jekyll-cache/ - - .github/ - - gemfiles/ - - Gemfile - - Gemfile.lock - - node_modules/ - - vendor/bundle/ - - vendor/cache/ - - vendor/gems/ - - vendor/ruby/ - - README.md diff --git a/_data/navlist.yml b/_data/navlist.yml deleted file mode 100644 index fec4d51..0000000 --- a/_data/navlist.yml +++ /dev/null @@ -1,11 +0,0 @@ -docs: - - - title: Home - url: / - - - title: About Wattle - url: /about_wattle - - - title: License - url: /license - diff --git a/_includes/logo.html b/_includes/logo.html deleted file mode 100644 index e69d387..0000000 --- a/_includes/logo.html +++ /dev/null @@ -1,8 +0,0 @@ -

- - - - WattleScript - - -

diff --git a/_includes/nav.html b/_includes/nav.html deleted file mode 100644 index 96f1237..0000000 --- a/_includes/nav.html +++ /dev/null @@ -1,19 +0,0 @@ - - \ No newline at end of file diff --git a/_plugins/fancyimage_tag.rb b/_plugins/fancyimage_tag.rb deleted file mode 100644 index c83b8ea..0000000 --- a/_plugins/fancyimage_tag.rb +++ /dev/null @@ -1,176 +0,0 @@ -# Title: Fancyimage tag for Jekyll -# Authors: Devin Weaver (photos_tag.rb), Brian M. Clapper (img_popup.rb), Patrick Paul (this gist) -# Description: Takes full size image, automagically creates thumbnail at specified size, +fancybox -# -# Adapted from: -# http://tritarget.org/blog/2012/05/07/integrating-photos-into-octopress-using-fancybox-and-plugin/ -# (photos_tag.rb) https://gist.github.com/2631877 -# (img_popup.rb) https://github.com/bmc/octopress-plugins/ -# -# Syntax {% photo filename [tumbnail] [title] %} -# Syntax {% photos filename [filename] [filename] [...] %} -# If the filename has no path in it (no slashes) -# then it will prefix the `_config.yml` setting `photos_prefix` to the path. -# This allows using a CDN if desired. -# -# To make FancyBox work well with OctoPress You need to include the style fix. -# In your `source/_include/custom/head.html` add the following: -# -# {% fancyboxstylefix %} -# -# Markup: -# {% fancyimage right /path/to/image.png 200x100 This is a cool title! %} -# -# {% fancyalbum 100x100! %} -# /uploads/image.png: Image caption here -# /another/upload.png -# {% endfancyalbum %} -# -# Output: -# -# This is a cool title! -# -# Todo: -# Figure out how to generate thumbnail images directly into /public/ folder -# (instead of to /source/ -> rake generate) -# -# Installation: -# Forthcoming. Look at the plugins I adapted off of for now. -# I also aliases 'rake bake' to 'rake generate, rake generate, rake deploy' -# because the thumbnails only generate -> /public/ the second time around. - -require 'digest/md5' -require 'mini_magick' - -module Jekyll - - class FancyboxStylePatch < Liquid::Tag - def render(context) - return <<-eof - - - eof - end - end - - class FancyImageTag < Liquid::Tag - def initialize(tag_name, markup, tokens) - args = markup.strip.split(/\s+/, 4) - - raise "Usage: fancyimage img-class filepath 123x456 [title] (input: fancyimage #{markup})" unless [3, 4].include? args.length - - @class = args[0] - @filename = args[1] - @dimensions = args[2] - @title = args[3] - super - end - - def render(context) - warn "rendering" - # Determine the full path to the source image - source = Pathname.new(context.registers[:site].source).expand_path - expfilename = context[@filename] - puts expfilename - image_path = source + expfilename.sub(%r{^/}, '') - basename = File.basename(image_path) - - # Determine the full path to the thumb image - #destination = source.sub("#{context.environments.first['site']['source']}","#{context.environments.first['site']['destination']}") - destination = source # the above line doesnt work -- how can I generate thumbnails into Jekyll public directly? - image_extension = File.extname(basename) - safe_dims = (@dimensions).gsub(/!/,"_abs") # replace ! with _abs since filenames can't contain it - thumb_filename = "thumbs/" + basename.split(".")[0] + "_" + safe_dims + image_extension - thumb_path = destination + thumb_filename.sub(%r{^/}, '') - warn thumb_path - # Resize and write the thumbnail image, if it doesn't exist yet - if not File.exists?(thumb_path) - thumb = MiniMagick::Image.open(image_path) - thumb.resize(@dimensions) - thumb.write(thumb_path) - end - - if expfilename - "\"#{@title}\"" - else - "Error processing input, expected syntax: {% fancyimage img-class filename 123x456 [title] %}" - end - end - end - - class FancyAlbumTag < Liquid::Block - #Sample syntax: - #{% gallery %} - #photo1.jpg - #photo2.jpg[thumb2.jpg] # REMOVED - #photo3.jpg[thumb3.jpg]: my title 3 # REMOVED - #photo4.jpg: my title 4 - #{% endgallery %} - - def initialize(tag_name, markup, tokens) - args = markup.strip.split(/\s+/, 4) - - raise "Usage: fancyalbum 123x456 (input: fancyalbum #{markup})" unless [1].include? args.length - - @dimensions = args[0] - super - end - - def render(context) - lines = "#{@nodelist}" # ["\nimages/midasfull.png: my title 1\nuploads/Fahrenheit451.jpg: my title 2\nimages/midasfull.png: my title 3\n"] - md5 = Digest::MD5.hexdigest(lines) - lines = lines.gsub(/^\[/,'') - lines = lines.gsub(/^\]/,'') - lines = lines.gsub(/^\"/,'') - lines = lines.split('\n') - list = "" - - lines.each do |line| - if line.length < 3 # this is how we purge empty rows within the tag block - next - end - if /(?[^\[\]:]+)?(?::(?.*))?/ =~ line - # Determine the full path to the source image - #filename = filename.gsub(/\n/,'') - source = Pathname.new(context.registers[:site].source).expand_path - image_path = source + filename.sub(%r{^/}, '') - basename = File.basename(image_path) - - # Determine the full path to the thumb image - #destination = source.sub("#{context.environments.first['site']['source']}","#{context.environments.first['site']['destination']}") - destination = source # the above line doesnt work -- how can I generate thumbnails into Jekyll public directly? - image_extension = File.extname(basename) - safe_dims = (@dimensions).gsub(/!/,"_abs") # replace ! with _abs since filenames can't contain it - thumb_filename = "/thumbs/" + basename.split(".")[0] + "_" + safe_dims + image_extension - thumb_path = destination + thumb_filename.sub(%r{^/}, '') - - # Resize and write the thumbnail image, if it doesn't exist yet - if not File.exists?(thumb_path) - thumb = MiniMagick::Image.open(image_path) - thumb.resize(@dimensions) - thumb.write(thumb_path) - end - list << "<li><a href=\"#{filename}\" class=\"fancybox\" rel=\"gallery-#{md5}\" title=\"#{title.strip}\">" - list << "<img src=\"#{thumb_filename}\" alt=\"#{title.strip}\" /></a></li>\n" - end - end - "<ul class=\"gallery\">\n#{list}</ul>" - end - end - -end - -Liquid::Template.register_tag('fancyimage', Jekyll::FancyImageTag) -Liquid::Template.register_tag('fancyalbum', Jekyll::FancyAlbumTag) -Liquid::Template.register_tag('fancyboxstylefix', Jekyll::FancyboxStylePatch) diff --git a/_layouts/default.html b/about_wattle.html similarity index 56% rename from _layouts/default.html rename to about_wattle.html index ff61bec..5b487bf 100644 --- a/_layouts/default.html +++ b/about_wattle.html @@ -1,7 +1,7 @@ <!DOCTYPE html> <html> <head> - <title>{{ page.title }} - {{ site.title }} + About Wattle - WattleScript @@ -47,16 +47,54 @@
- {% include logo.html %} +

+ + + + WattleScript + + +

+
- {{ content }} +

About Wattle

+ +

Wattle is a scripting language for the WattleScript VM inspired by JavaScript, C# and Lua.

+ +

Using Wattle

+ +

To change your script’s language to Wattle, simply change the Syntax option in the ScriptOptions class to ScriptSyntax.Wattle.

+ +
diff --git a/about_wattle.markdown b/about_wattle.markdown deleted file mode 100644 index 064111a..0000000 --- a/about_wattle.markdown +++ /dev/null @@ -1,14 +0,0 @@ ---- -layout: default -title: About Wattle ---- - -# About Wattle - -Wattle is a scripting language for the WattleScript VM inspired by JavaScript, C# and Lua. - - -## Using Wattle - -To change your script's language to Wattle, simply change the `Syntax` option in the `ScriptOptions` class to `ScriptSyntax.Wattle`. - diff --git a/feed.xml b/feed.xml new file mode 100644 index 0000000..7c7b842 --- /dev/null +++ b/feed.xml @@ -0,0 +1 @@ +Jekyll2022-04-14T00:26:47+00:00https://wattlescript.github.io/feed.xmlWattleScriptWattleScript \ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..8432179 --- /dev/null +++ b/index.html @@ -0,0 +1,128 @@ + + + + Home - WattleScript + + + + + + + + + + + + +
+
+

+ + + + WattleScript + + +

+ + +
+
+
+
+
+

WattleScript

+ +

WattleScript is a scripting engine written in C# for runtimes supporting .NET Standard 2.0 and newer. (.NET 4.7.2+, .NET Core 3.1+). It is a dual-language environment, providing support for Lua 5.2 code as well as its own language, Wattle.

+ +

Using WattleScript is as easy as:

+ +
var script = new Script();
+script.DoString("print('Hello World!')");
+
+ +

WattleScript is based off the tried and tested MoonSharp project, inheriting its VM design and test suite. The design focuses on easy and fast interop with .NET objects and functions.

+ +

Features

+ +
    +
  • Wattle scripting language.
  • +
  • Lua mode 99% compatible with Lua 5.2, differences documented here.
  • +
  • Easily configured sandbox for safe execution of untrusted scripts.
  • +
  • Minimal garbage generation at runtime.
  • +
  • No external dependencies.
  • +
  • Easy and performant interop with CLR objects, with runtime code generation where supported.
  • +
  • Source Generator for AOT interop.
  • +
  • Support for awaiting on returned values.
  • +
  • Supports dumping/loading bytecode.
  • +
  • Support for the complete Lua standard library with very few exceptions (mostly located in the debug module).
  • +
  • json module for loading json into tables safely at runtime.
  • +
+ +

License

+ +

WattleScript is licensed under the 3-clause BSD License. See LICENSE for details.

+ + +
+
+ + + + + diff --git a/index.markdown b/index.markdown deleted file mode 100644 index 84d77d7..0000000 --- a/index.markdown +++ /dev/null @@ -1,36 +0,0 @@ ---- -layout: default -title: Home ---- - -# WattleScript - -WattleScript is a scripting engine written in C# for runtimes supporting .NET Standard 2.0 and newer. (.NET 4.7.2+, .NET Core 3.1+). It is a dual-language environment, providing support for Lua 5.2 code as well as its own language, Wattle. - -Using WattleScript is as easy as: - -```cs -var script = new Script(); -script.DoString("print('Hello World!')"); -``` - -WattleScript is based off the tried and tested [MoonSharp](https://moonsharp.org) project, inheriting its VM design and test suite. The design focuses on easy and fast interop with .NET objects and functions. - -## Features - -* [Wattle](about_wattle) scripting language. -* Lua mode 99% compatible with Lua 5.2, differences documented [here](lua_differences). -* Easily configured sandbox for safe execution of untrusted scripts. -* Minimal garbage generation at runtime. -* No external dependencies. -* Easy and performant interop with CLR objects, with runtime code generation where supported. -* Source Generator for AOT interop. -* Support for awaiting on returned values. -* Supports dumping/loading bytecode. -* Support for the complete Lua standard library with very few exceptions (mostly located in the `debug` module). -* `json` module for loading json into tables safely at runtime. - -## License - -WattleScript is licensed under the 3-clause BSD License. See [LICENSE](license) for details. - diff --git a/license.html b/license.html new file mode 100644 index 0000000..c189990 --- /dev/null +++ b/license.html @@ -0,0 +1,136 @@ + + + + License - WattleScript + + + + + + + + + + + + +
+
+

+ + + + WattleScript + + +

+ + +
+
+
+
+
+

BSD 3-Clause License

+ +

Copyright (c) 2014-2022 The WattleScript Authors, as shown by the AUTHORS file. +All rights reserved.

+ +

Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met:

+ +
    +
  • +

    Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer.

    +
  • +
  • +

    Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation +and/or other materials provided with the distribution.

    +
  • +
  • +

    Neither the name of the copyright holder nor the names of its +contributors may be used to endorse or promote products derived from +this software without specific prior written permission.

    +
  • +
+ +

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

+ +

Parts of the string library are based on the KopiLua project (https://github.com/NLua/KopiLua) +Copyright (c) 2012 LoDC

+ +

The MoonSharp icon is (c) Isaac, 2014-2015

+ +
+
+ + + + + diff --git a/license.markdown b/license.markdown deleted file mode 100755 index a146ec5..0000000 --- a/license.markdown +++ /dev/null @@ -1,39 +0,0 @@ ---- -layout: default -title: License ---- - -# BSD 3-Clause License - -Copyright (c) 2014-2022 The WattleScript Authors, as shown by the AUTHORS file. -All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -* Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - -* Neither the name of the copyright holder nor the names of its - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -Parts of the string library are based on the KopiLua project (https://github.com/NLua/KopiLua) -Copyright (c) 2012 LoDC - -The MoonSharp icon is (c) Isaac, 2014-2015 diff --git a/lua_differences.html b/lua_differences.html new file mode 100644 index 0000000..02af224 --- /dev/null +++ b/lua_differences.html @@ -0,0 +1,125 @@ + + + + Differences between WattleScript Lua and Lua - WattleScript + + + + + + + + + + + + +
+
+

+ + + + WattleScript + + +

+ + +
+
+
+
+
+

Differences between WattleScript Lua and Lua

+ +

WattleScript’s Lua mode contains minor differences and a few additions, inherited from MoonSharp.

+ +

List of Differences

+ +
    +
  • Strings are Unicode: some caution is required if code uses strings to store binary data. On the other hand, strings used as real strings are a lot easier to use.
  • +
  • Garbage Collection is different, as WattleScript makes use of the .NET GC. Notably this makes collectgarbage() a no-op.
  • +
  • Compatibility is source-only, WattleScript cannot load luac binaries.
  • +
  • Slight differences in error messages.
  • +
  • Function names are tracked at function declaration, not backtracked at function calls like in Lua (noticeable only when debugging)
  • +
+ +

List of Additions

+ +
    +
  • Multiple expressions can be used as indices but the value to be indexed must be a userdata, or a table resolving to userdata through the metatable (but without using metamethods). So, for example, x[1,2,i] is parsed correctly but might raise an error if x is not a userdata.
  • +
  • Metalua short anonymous functions (lambda-style) are supported. So |x, y| x + y is shorthand for function(x,y) return x+y end.
  • +
  • A non-yieldable __iterator metamethod has been added. It’s called if the argument f of a for ... in ... loop is not actually a function.
  • +
  • A default iterator is provided if the argument f of a for ... in ... loop is a table without __iterator or __call metamethods. The provided result is value, key unlike ipairs or pairs.
  • +
  • \u{xxx} escapes, where x are up to 8 hexadecimal digits, are supported inside strings and will output the specified Unicode codepoint, as it does in Lua 5.3
  • +
  • loadsafe and loadfilesafe methods, same as load and loadfile but defaulting to the current top-of-the-stack _ENV instead of the default one, for easier sandboxing
  • +
  • The dynamic.eval and dynamic.prepare functions to handle dynamic expressions
  • +
  • string.unicode method, just like string.byte but returning a whole unicode codepoint
  • +
  • string.contains, string.startsWith and string.endsWith methods allow easier and faster performing string ops without having to rely on patterns for simple scenarios
  • +
  • The json module to support JSON<->table conversions
  • +
+ + +
+
+ + + + + diff --git a/lua_differences.markdown b/lua_differences.markdown deleted file mode 100644 index 3540af8..0000000 --- a/lua_differences.markdown +++ /dev/null @@ -1,30 +0,0 @@ ---- -layout: default -title: Differences between WattleScript Lua and Lua ---- - -# Differences between WattleScript Lua and Lua - -WattleScript's Lua mode contains minor differences and a few additions, inherited from MoonSharp. - -### List of Differences - -* Strings are Unicode: some caution is required if code uses strings to store binary data. On the other hand, strings used as real strings are a lot easier to use. -* Garbage Collection is different, as WattleScript makes use of the .NET GC. Notably this makes `collectgarbage()` a no-op. -* Compatibility is source-only, WattleScript cannot load luac binaries. -* Slight differences in error messages. -* Function names are tracked at function declaration, not backtracked at function calls like in Lua (noticeable only when debugging) - -### List of Additions - -* Multiple expressions can be used as indices but the value to be indexed must be a userdata, or a table resolving to userdata through the metatable (but without using metamethods). So, for example, ``x[1,2,i]`` is parsed correctly but might raise an error if ``x`` is not a userdata. -* Metalua short anonymous functions (lambda-style) are supported. So ``|x, y| x + y`` is shorthand for ``function(x,y) return x+y end``. -* A non-yieldable ``__iterator`` metamethod has been added. It's called if the argument ``f`` of a ``for ... in ... `` loop is not actually a function. -* A default iterator is provided if the argument ``f`` of a ``for ... in ...`` loop is a table without ``__iterator`` or ``__call`` metamethods. The provided result is `value, key` unlike `ipairs` or `pairs`. -* ``\u{xxx}`` escapes, where x are up to 8 hexadecimal digits, are supported inside strings and will output the specified Unicode codepoint, as it does in Lua 5.3 -* ``loadsafe`` and ``loadfilesafe`` methods, same as ``load`` and ``loadfile`` but defaulting to the current top-of-the-stack ``_ENV`` instead of the default one, for easier sandboxing -* The ``dynamic.eval`` and ``dynamic.prepare`` functions to handle dynamic expressions -* ``string.unicode`` method, just like ``string.byte`` but returning a whole unicode codepoint -* ``string.contains``, ``string.startsWith`` and ``string.endsWith`` methods allow easier and faster performing string ops without having to rely on patterns for simple scenarios -* The ``json`` module to support JSON<->table conversions - diff --git a/robots.txt b/robots.txt new file mode 100644 index 0000000..51dad5c --- /dev/null +++ b/robots.txt @@ -0,0 +1 @@ +Sitemap: https://wattlescript.github.io/sitemap.xml diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..d2e5023 --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,15 @@ + + + +https://wattlescript.github.io/about_wattle.html + + +https://wattlescript.github.io/ + + +https://wattlescript.github.io/license.html + + +https://wattlescript.github.io/lua_differences.html + +