CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 10:40:20 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"f927d57784bc179d38f9b93a9576bdb6"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=ykRiQV5hw1%2FF%2BP3k8B1FEGKSSbLP7fxTHMmWznpVLqzGebFM%2BrvYELmlulbHdiT3lOj%2F%2Bn7Qd9wSjzWqW8wKAUZrS5jwa7XiDNxASLxxJugUn43KL2W6yhrzYlBdxa3kpZGMPeGVCB0cBeISLtX3pyd7PAVupfBRgyOEtetKwyLktzbq39cOsMzu3B1zIvVUvJkw%2BT3z0w2DDpsdzjjdh12qAGxngtKdPLWH8%2FHJ4k1gqtzmq6CrjIBXsiW1otX%2BQ2sJ6CnkW05Cy12hUIIQTA%3D%3D--ugnGKkLi%2FBihom%2Fk--1SvPQvcvUPpYSAX1Y6SovA%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.574708046.1753612819; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 10:40:19 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 10:40:19 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: C238:363053:D4F833:1196241:68860213
GitHub - sebastien/sugar: Makes JavaScript development sweeter !
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 3
sebastien/sugar
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
== Sugar == The secret sauce to make JavaScript a lot sweeter ! Sugar is a _new programming language_ designed to replace JavaScript for client-side (and server-side) web development. Sugar is inspired by languages such as Python, Smalltalk, Pascal, Eiffel and Lisp. Sugar can compile to JavaScript, ActionScript and Python. For the impatient, here is an example of Sugar's syntax: > @module helloworld > > @class HelloWorld > | This is a docstring for my hello world > > @property message > > @constructor > message = "Hello, World !" > @end > > @method say > alert ( message ) > @end > > @end Design goals ============ Sugar was designed with *software engineering in mind*, which means the core values are _readability_, _maintainability_ and _expressivity_. While Sugar does no forces you to use objects everywhere, it encourages you to use classes (yes, sugar also has class-based inheritance) and focus on your program architecture. Sugar design goals include: - Can be learned in a couple of days by average developers - Abstract from common JavaScript pitfalls - Minimize the differences in the code produced by different coders - Capture more information than other languages (be explicit) Sugar owes the following languages in different areas: - Python, for the simplicity and cleanliness of the syntax - Eiffel, for the design by contract support - Smalltalk, for blocks - Io, for the message sending syntax - ML, for the pattern-matching syntax - Lisp, for the map/reduce/filter support Installing sugar ================ Sugar is implemented in Python (2.4+) and uses the [DParser](https://dparser.sf.net), and relies on the [LambdaFactory](https://www.github.com/sebastien/lambdafactory) library. If you don't already have _dparser_, you should do the following: > cd Dependencies ; bash make-dparser.sh and then copy the 'Dependencies/dparser' directory to somewhere in your 'PYTHONPATH' or do > export PYTHONPATH=`pwd`/Dependencies/dparser:${PYTHONPATH} We're slowly getting away from DParser, as it has problems with 64 bits, and is not flexible enough for the future of Sugar. In the meantime, please bear with it ;) Once you have DParser and LambdaFactory installed, simply type: > python setup.py install And you'll have sugar install, and will have the 'sugar' command available in your path. Alternatively, if you'd like to hack on Sugar, you could do: > export PYTHONPATH=`pwd`/Sources > alias sugar=`pwd`/Sources/sugar/main (and you could later include these in your '~/.bash_profile', making sure to replace '`pwd`' by the actual Sugar directory). Using sugar =========== Compile a Sugar file to JavaScript > sugar -c hello.sjs Compile a Sugar file to Python > sugar -clpy hello.sjs Compile a Sugar file to ActionScript > sugar -clas hello.sjs Compile a Sugar file to a directory > sugar -cl -o. hello.sjs Add a library (LIBRARY) path to search for Sugar modules > sugar -cl -LLIBRARY hello.sjs Troubleshooting =============== I get the following error: > fail: unable to open `/usr/local/bin/d_parser_mach_gen.g` for write This is because Dparser is trying to write a tempoary file along with the executable. Move the 'sugar' command to a directory where you have write permission (like '~/bin'). We know it's annoying, and we're working on a new version without dparser. # EOF - vim: syn=kiwi ts=2 sw=2 et
About
Makes JavaScript development sweeter !
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
You can’t perform that action at this time.