A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/joshgoebel/wren-console below:

joshgoebel/wren-console: A CLI/repl tool for Wren written in pure Wren (aMaP)

The Wren Console project is a small and simple REPL and CLI tool for running Wren scripts. It is backed by libuv to implement IO functionality. It is based on the official Wren CLI project and very much a work in progress.

The goals and priorities are slightly different than the Wren CLI project.

For now the idea is to try to maintain compatibility with whe Wren CLI modules themselves, so that reference documentation may prove useful.

For more information about Wren, the language that Wren Console is embedding, see http://wren.io.

We welcome contributions. Feel free to open an issue to start a discussion or join our Discord. You can also find me on the main Wren Discord as well.

Thousands of helpful mentors, hundreds of thousands of fellow students to learn alongside. If you're wanting to learn a new language, improve your Wren, or just sharpen your skills on an entirely different language, Exercism is the place to be.

Start up an interactive REPL session:

Run a script from the console:

$ wrenc ./path_to_script.wren

Evaluate code directly:

$ wrenc -e 'System.print("Hello World!")'

Executable Wren scripts:

Use the typical "shebang" for executable wren scripts:

#!/usr/bin/env wrenc
import "io" for Stdin
System.print("Enter your name:")
var name = Stdin.readLine().trim()
System.print("Hello %(name.isEmpty ? "World" : name)!")

(Note: for Linux folk, this is documented in the execve(2) man page.)

Embed Wren code in a shell script:

This makes smart use of file descriptors and the Linux /dev file system to read the code from a here-document while also keeping standard input available for wren:

#!/bin/sh
wrenc /dev/fd/5 < input.txt 5<< 'EOF'
import "io" for Stdin
System.print(Stdin.readLine())
EOF

Our hope is to extend the libraries available without breaking forwards compatibility - meaning that a script running successfully on Wren CLI should run as-is on Wren Console - but once you start using the newer library features your script may no longer run be backwards compatible with Wren CLI.

Dirt simple package management/dependencies for Wren Console projects.

Argument validation...

Example:

static sleep(milliseconds) {
  Ensure.positiveNum(milliseconds, "milliseconds")
  // ...
}  

Retrieve details about the runtime environment.

Experimental. See wren-lang/wren#1006.

Wren Console includes the Wren Essentials library built right into the binary.

If you're using Homebrew we have a tap for you. Otherwise you can check out our binary releases or simply build from source.

With Homebrew:

brew tap exercism/wren
brew install wren-console

Pre-requisites

The projects/vs20xx folders contain Visual Studio projects.

The projects/xcode folder contains an Xcode project.

The projects/make.mac folder also contains a make project.
From that folder, run make.

cd projects/make.mac
make

The projects/make folder contains a make project.
From that folder, run make.

cd projects/make
make

The projects/make.bsd folder contains a make project.
From that folder, run make.

cd projects/make.bsd
gmake

Alternative build options

The projects are generated by premake, found inside projects/premake.
You can use premake5 (alpha 14 was used) to generate other projects.
Generate other system's projects via the premake --os flag,
i.e if on linux, premake vs2019 --os=windows is valid.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4