Giter Club home page Giter Club logo

ragnardanneskjold / anarki Goto Github PK

View Code? Open in Web Editor NEW

This project forked from arclanguage/anarki

0.0 2.0 0.0 3.19 MB

Community-managed fork of the Arc dialect of Lisp; for commit privileges submit a pull request.

Home Page: http://arclanguage.github.io

License: Other

Racket 9.70% Arc 72.76% Shell 1.15% Batchfile 0.04% CSS 0.59% JavaScript 0.13% Perl 6.66% Emacs Lisp 4.40% Vim Script 2.87% Python 0.40% XSLT 0.40% Terra 0.84% Perl 6 0.05%

anarki's Introduction

Anarki Travis build

A publicly modifiable 'wiki-like' fork of Arc Lisp

The intention is to be extremely permissive in accepting patches. For commit privileges, just submit your first pull request or ask on Arc Language Forum.

Getting started

Installation

First install Racket (v6.11 or later), then

$ raco pkg install sha
$ git clone http://github.com/arclanguage/anarki
$ cd anarki
$ ./arc.sh    # start the interactive repl
$ cd apps/news
$ ./run-news  # or start News (also with the repl)

Tutorial

If you're new to Arc, or Lisp in general, a good starting point is the Tutorial.

Documentation and help

If you run into trouble, check

News Site

Anarki comes bundled with News, a Hacker News style app.

Admins

To run News, first pick your (the admin's) username,

$ cd anarki/apps/news
$ mkdir www
$ echo __username__ > www/admins

You can have multiple admins. Add them all to www/admins, separated by whitespace.

Starting the server

Warning: If you are already running a News site, migrating to this fork might mess up your site's data. Come talk to us first, and be sure to make a backup before the migration.

Now bring up the server,

$ ./run-news

There'll be a pause while the server loads up, with some messages, then you'll see the arc> prompt.

Go to http://localhost:8080. Click on login, and create the account for your username. You should now be logged in as an admin.

(Don't worry about user break or error writing messages.)

Customization

To customize News, change the variables at the top of apps/news/news.arc. To change the port your server runs at, modify apps/news/run-news.arc.

Any interactive changes to the prompt will be reflected immediately in the server, without needing to restart it. Hence if you make any changes to apps/news/news.arc, you can load them, by typing (load "apps/news/news.arc") in the repl. If you stop the server or it dies for some reason, previously entered commands are available in the command history (at least if you have Readline installed).

HTTPS

You may want to serve News securely over HTTPS. An example configuration for running Nginx with SSL as a reverse proxy for News can be found in anarki/extras/news.nginx.conf.

Resetting passwords

For password reset mails to be sent out, your must set up an email account to send these from,

$ echo "[email protected]" > www/app-email  ; email
$ echo "smtp.example.com" >> www/app-email     ; smtp server
$ echo "[email protected]" >> www/app-email  ; user
$ echo "1234" >> www/app-email                 ; password

Development

Tests

Anarki has thorough automated tests. To run them, install Mercurial, then,

# start in the anarki directory
$ hg clone https://bitbucket.org/zck/unit-test.arc
$ ./arc.sh
arc> (load "tests.arc")

Anarki is explicitly not constrained to maintain compatibility with upstream releases, and compatibility status may swing wildly from commit to commit depending on who takes an interest. To see a list of what's different, type (incompatibilities) at the repl. If you make an incompatible change, please update this list.

Racket interop

Racket expressions can be evaluated with the ($ ...) syntax. For instance, (($ crypto-random-bytes) 16) obtains the crypto-random-bytes function from Racket and makes a call to it.

If you write lots of Racket code and you just want to use Anarki for part of a bigger project, you can raco pkg install anarki and use Anarki to write Racket modules:

#lang anarki
(:provide function-for-use-in-racket)

(= racket-import ($.dynamic-require ...))
(load "relative/path.arc")

(def utility-for-use-in-racket (x)
  (* x (racket-import x))

Scope

Note that Anarki does not have private module scopes; the (:provide ...) section is just there to make it easy to require an Anarki-based library from Racket.

Keyword arguments

Anarki has some issues passing keyword arguments to Racket functions, but Racket's keyword-apply can be used for that.

anarki's People

Contributors

akkartik avatar alimoeeny avatar awwx avatar axiak avatar blackstag avatar brandonbloom avatar brianru avatar camden-smallwood avatar dijonkitchen avatar dram avatar edwardbetts avatar eikes avatar hasenj avatar hjek avatar huetsch avatar jazzdev avatar kennethrapp avatar kinnardian avatar malisper avatar nex3 avatar prozion avatar rntz avatar rocketnia avatar shader avatar shirriff avatar svetlyak40wt avatar twilightsentry avatar waterhouse avatar womble avatar zck 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.