Code Monkey home page Code Monkey logo

farabi6's People

Contributors

altai-man avatar azawawi avatar mj41 avatar timo avatar zoffixznet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

farabi6's Issues

Add project

Create a new directory structure with the META.json for a sample p6 module.

[command-line] Open file

It would be cool to open a file. If the farabi6 has not been started on that port, send the file to be opened by that farabi6 instance. If not, start the farabi6 server and open that file ๐Ÿ‘

The file can also be a directory so basically copy what vim does and do it in style ๐Ÿ‘

Future Ideas...

When we have page state, an interesting idea is to give the programmer the ability to put code/text blocks in different orientations.

  • 4x1, 1x4, 2x1, 1x2 , ...etc
  • Editor and Output can be vertical or horizontal.
  • An interesting idea to explore is the "Write code" tab and "Run" code tab like Github to save space
  • In the future, A script is linked to other files (e.g. imports). Display a list of files that you can open.

Broken in current rakudo-star 2012-12

I hope this helps

regards
bowtie

panda install Farabi6
==> Fetching Farabi6
==> Building Farabi6
Mu()
resolve stage failed for Farabi6: Malformed UTF-8 string

in block at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Panda.pm:86
in method get at src/gen/CORE.setting:7599
in code at src/gen/CORE.setting:7620
in sub coro at src/gen/CORE.setting:5633
in method reify at src/gen/CORE.setting:5615
in method reify at src/gen/CORE.setting:5397
in method reify at src/gen/CORE.setting:5397
in method reify at src/gen/CORE.setting:5487
in method reify at src/gen/CORE.setting:5397
in method reify at src/gen/CORE.setting:5397
in method gimme at src/gen/CORE.setting:5775
in method eager at src/gen/CORE.setting:5754
in method eager at src/gen/CORE.setting:1189
in sub eager at src/gen/CORE.setting:6052
in method build-order at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Panda/Builder.pm:21
in method build at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Panda/Builder.pm:51
in method build-helper at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Pies.pm:50
in method resolve-helper at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Pies.pm:85
in method resolve at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Pies.pm:98
in any call_with_capture at src/gen/Metamodel.pm:2794
in block at src/gen/CORE.setting:541
in method resolve at /home/kevin/rakudo/rakudo-star-2012.12/install/lib/parrot/4.10.0/languages/perl6/lib/Panda.pm:84
in block at /home/kevin/rakudo/rakudo-star-2012.12/install/bin/panda:119
in method reify at src/gen/CORE.setting:5495
in method reify at src/gen/CORE.setting:5397
in method reify at src/gen/CORE.setting:5397
in method gimme at src/gen/CORE.setting:5775
in method eager at src/gen/CORE.setting:5754
in method eager at src/gen/CORE.setting:1189
in sub eager at src/gen/CORE.setting:6052
in sub MAIN at /home/kevin/rakudo/rakudo-star-2012.12/install/bin/panda:116
in block at /home/kevin/rakudo/rakudo-star-2012.12/install/bin/panda:112

[CodeMirror] Smaller and faster future upgrade script

At the time of this writing, all of CodeMirror 4.6 JavaScript editing component is included in Farabi6. And farabi6 is not utilizing/need all the modes or functionality of that package. It would be cool to do the following in a Perl 6 build script:

  • Work on a ~/codemirror folder. It is assumed to contain the latest version to upgrade to
  • Copy the lib, addon, ...etc that is needed in the current farabi6 installation
  • Copy the modes that are supported in Farabi6. Weird modes to be excluded
  • Remove cruft like index.html, test.html and test.js
  • Copy the filtered codemirror package to $FARABI_GIT_FOLDER/lib/Farabi6/files/assets/3rd-party/codemirror-v4.6
  • Copy the license file
  • Copy a README to tell that this is version xyz with the modifications made.

[Run, REPL] if we have async I/O available, use it

this is interesting for the repl and execution in general:

if you have long-running code or even an infinitely looping piece of code, the web server farabi6 uses mustn't hang waiting for stuff to finish. Also,the user should be able to kill a run-away process from the web interface as well.

On MoarVM, Proc::Async would be a good choice to connect to a repl (not only because of killability) and distributing updates (status, output, ...) via EventSource would be a pretty neat thing to do

Mime-type detection based on filename and content

Farabi6 must start to load the correct CodeMirror editor mode for the opened file.. This should include the following:

  • Padre-style Perl 6 mime-type detection
  • Padre-style Perl 5 mime-type detection

[command-line] Open file and goto line

It would be cool to have the following scenario:

farabi6 <filename><colon ":"><line-number>
# e.g.
farabi6 lib/Farabi6.pm6:115

This code will open Farabi6.pm6 and then go to the line #115

Implement Github-style Directory browser

The github-style directory browser user interface should allow user-mounted directories to be viewed. Later an indexer process will index those user-mounted directories to make searching faster.

Perl 6 Web-based REPL

See https://github.com/perl6/nqp/blob/master/src/HLL/Compiler.nqp#L54

use v6;

use IO::Capture::Simple;

my $save_ctx;
my $comp = nqp::getcomp('perl6');
while 1
{
    my $code = prompt("> ");
    my ($out, $result);
    try
    {
        capture_stdout_on($out);
        $result = $comp.eval($code, :outer_ctx($save_ctx));
        capture_stdout_off;

        CATCH
        {
            default
            {
                capture_stdout_off;

                say "Error: $_";
                say $_.backtrace.Str;
            }
        }
    }

    say("result => " ~ $result) if defined $result;
    say("stdout => " ~ $out) if defined $out;
}

# vim: ft=perl6

O wise one, enhancement

can you enable the directory browser on file input please

also info only

perl6 -> rakudo is in path as perl6

p6 -> Niecza via a sh in ~/bin

I thought this would be helpful.

ps p6 is very pretty output

[Panda] Module Search Sidebar

panda --list provides a list of installed/dependency modules in the current installation

Similar to Perl 6 REPL right sidebar, one can implement a module search that enables searching as follows:

  • Empty search pattern returns all matches
  • A full Search pattern is applied as /$pattern/ to all the list and matches are displayed

Rename farabi6 to Totem :)

I dont know why but it can be a fun idea for all the world shamans ๐Ÿ‘

Let us heal thy wounds with our Perl 6

POD after __END__

pod after END

===SORRY!=== CHECK FAILED: Undefined routine '&END' called (line 7)

just an observation, for you

Handle stability problems when running it over feather.perl6.nl

First culprit

https://github.com/supernovus/perl6-http-easy/blob/master/lib/HTTP/Easy.pm6#L71

    [2014-10-12T06:15:03Z] GET /assets/mode-perl6.js HTTP/1.1
    use of uninitialized value of type Any in numeric context  in method run at lib/HTTP/Easy.pm6:71

    No such method 'decode' for invocant of type 'Any'
      in method run at lib/HTTP/Easy.pm6:74
      in method run at ./lib/Farabi6.pm6:111
      in sub MAIN at bin/farabi6:16
      in block <unit> at bin/farabi6:16

[Test] More

We need to test Farabi6 HTTP methods especially in Farabi6.pm, Editor.pm6 and et al.

Implement New file command

This is implemented but we need a more generic approach like naming the new editing buffer before or waiting until saved.

[Syntax Check] On Save

We should adopt Eclipse IDE style of syntax checking on buffer/file save since syntax checking is an expensive operation at the moment.

Storyboard JSON Load/Save

A storyboard is a timeline of files and misc output/images that is added.

New File should be changed to "Add..."
Open file should be changed to "Add Existing..."

[Module Search] Insert Snippet support

This has been discussed in http://irclog.perlgeek.de/perl6/2014-10-13#i_9503397

Basically created a feature to add snippets if the module has been installed

By default we pull from the module's github repository:

example/snippets/task1.pl
example/snippets/task2.pl
example/snippets/task3.pl

    21:52 azawawi     take a look at http://pbrd.co/1w2zEvz plz
    21:53 bbkr        azawawi: nice thinking!
    21:53 azawawi     when the user clicks on the module on the right, we insert the snippets for the module selected
    21:54 bbkr        unfortunately SYNOPSIS is not easily exportable and is in various places (Readme.md, library POD) across different modules
    21:54 azawawi     now how can farabi6 determine that... i guess snippet.pl in root directory or something
    21:54 azawawi     and SYNOPSIS requires more parsing
    21:54 azawawi     which is prone to error
    21:55 azawawi     think of about, why did i panda install Module::XYZ....
    21:55 azawawi     1. to use...
    21:55 azawawi     it :)
    21:56 azawawi     i will add an initial feature to pull the snippet.pl from the root directory or eg/snippet.pl
    21:57 azawawi     if it is there, that snippet is directly inserted into the farabi6 storyboard
    21:58 azawawi     why is javascript so popular?... the number of steps/tools to create a working example is minimal
    21:58 pmurias     it's so popular because it's in the browser
    21:59 bbkr        does p5 specify example/snippets directory name?
    21:59 azawawi     nope
    21:59 tadzik      azawawi: oh, I see. That's cool :)
    22:00 azawawi     bbkr: example/snippets/task1.pl example/snippets/task2.pl example/snippets/task3.pl   # interesting
    22:01 azawawi     pmurias: true but the number of tools needed to make something work is a A) browser already there and B) an editor... easily obtained
    22:04 bbkr        azawawi: thought so :( and i don't think p6 does that either. directories like lib/ or t/ are just customary. I think the best bet is to look for common names such as example/ or snippets/ and offer to paste content from files there. however small number of p6 modules has those

Malformed UTF-8 ?

I'm on the latest rakudo build using moarvm (built 5 minutes ago) installed with panda (also fresh)
the server starts fine, I get the editor to load almost.... then this

[2014-08-25T04:21:45Z] GET /farabi.css HTTP/1.1
[2014-08-25T04:21:46Z] GET /assets/codemirror/util/match-highlighter.js HTTP/1.1
[2014-08-25T04:21:46Z] GET /assets/codemirror/util/search.js HTTP/1.1
[2014-08-25T04:21:47Z] GET /assets/bootstrap/img/glyphicons-halflings.png HTTP/1.1
Malformed UTF-8
in method slurp at src/gen/m-CORE.setting:14419
in sub at lib/Farabi6.pm6:88
in method handler at lib/HTTP/Easy/PSGI.pm6:33
in method run at lib/HTTP/Easy.pm6:155
in method run at lib/Farabi6.pm6:107
in sub MAIN at /home/ezra/rakudo/install/languages/perl6/site/bin/farabi6:16
in block at /home/ezra/rakudo/install/languages/perl6/site/bin/farabi6:16

re: on commit 394e616

Hi Ahmad,

I thought I would add info here, for you :)

when I start running ~/GitHub/farabi6$ bin/farabi6

Farabi6 is going to serve files insecurely from lib/Farabi6/files :)
Farabi6 listens carefully at http://:3030
14:29 HTTP::Server::Simple::PSGI() started at :3030
14:29 GET / HTTP/1.1
14:29 GET /jquery-1.8.2.min.js HTTP/1.1
14:29 GET /assets/bootstrap/css/bootstrap.min.css HTTP/1.1
14:29 GET /assets/bootstrap/js/bootstrap.min.js HTTP/1.1
14:29 GET /assets/codemirror/util/dialog.css HTTP/1.1
14:29 GET /assets/codemirror/codemirror.js HTTP/1.1
14:29 GET /assets/codemirror/util/loadmode.js HTTP/1.1
14:29 GET /assets/codemirror/codemirror.css HTTP/1.1
14:29 GET /assets/codemirror/util/match-highlighter.js HTTP/1.1
14:29 GET /assets/codemirror/util/search.js HTTP/1.1
14:29 GET /assets/codemirror/util/dialog.js HTTP/1.1
14:29 GET /farabi.css HTTP/1.1
14:29 GET /assets/codemirror/util/searchcursor.js HTTP/1.1
14:30
Type check failed in assignment to '$uri'; expected 'Str' but got 'Nil'
in sub at ./lib/Farabi6.pm6:40
in method handler at lib/HTTP/Server/Simple/PSGI.pm6:58
in method net_server at lib/HTTP/Server/Simple.pm6:64
in method run at lib/HTTP/Server/Simple.pm6:34
in method run at ./lib/Farabi6.pm6:99
in sub MAIN at bin/farabi6:9
in block at bin/farabi6:1

runs then exits, cmd log above,

ps I like the new menu/info bar :)

Farabi6 is not working on OSX/Linux/rakudobrew panda installations

Basically the algorithm to locate the location of the farabi.js is not working properly on a machine with a prefix ~/perl6/install on Mac OS X

A git cloned farabi6 will work while a panda installed farabi6 will not.

Please see:
http://irclog.perlgeek.de/perl6/2014-10-20#i_9537457

Another insight into the problem is:
http://irclog.perlgeek.de/perl6/2014-10-30#i_9587309

I think we need to investigate installing rakudo into ~/languages/...

Rosetta Code browser for Perl 6

Better Perl 6 Syntax highlighting

Currently CodeMirror, the JavaScript-based editing component in farabi6 does have any CodeMirror-maintained Perl 6 syntax highlighting mode. The mode that is currently maintained is based on the Perl mode and has a lot of problems. We need to fix it ASAP to make Perl 6 code look great on our platform. Once we have a good implementation, we should merge it with CodeMirror.

Perl 6 mode
https://github.com/azawawi/farabi6/blob/master/lib/Farabi6/files/assets/mode-perl6.js

Original Perl mode
https://github.com/codemirror/CodeMirror/blob/master/mode/perl/perl.js

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.