Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Sep 22 18:08
    Delja labeled #2790
  • Sep 22 18:08
    Delja unlabeled #2790
  • Sep 22 18:07
    Delja synchronize #2790
  • Sep 22 18:03
    Delja synchronize #2790
  • Sep 19 20:13
    Delja synchronize #2790
  • Sep 18 15:58
    Delja labeled #2790
  • Sep 18 15:57
    Delja unlabeled #2790
  • Sep 18 14:12
    Delja labeled #2790
  • Sep 18 14:12
    Delja unlabeled #2790
  • Sep 18 14:11
    Delja labeled #2790
  • Sep 18 14:11
    Delja unlabeled #2790
  • Sep 17 17:20
    Delja labeled #2790
  • Sep 17 17:20
    Delja unlabeled #2790
  • Sep 17 15:55
    Delja commented #1340
  • Sep 17 15:09
    Delja labeled #2790
  • Sep 17 14:44
    privat closed #2779
  • Sep 17 14:44
    privat closed #2791
  • Sep 17 14:44

    privat on master

    astbuilder: Make the constructi… astbuilder: Add a `create_calls… functional: Added universal typ… and 6 more (compare)

  • Sep 16 14:36

    privat on next

    astbuilder: Make the constructi… astbuilder: Add a `create_calls… functional: Added universal typ… and 6 more (compare)

  • Sep 16 14:30
    privat labeled #2791
Jake Russo
@MadcapJake
ok cool thanks!
Alexis Laferrière
@xymus
Jake Russo
@MadcapJake
Is there any list of interfaces like Comparable?
Jake Russo
@MadcapJake
nvm, just grepping around lib is giving me what i need
Jake Russo
@MadcapJake
how come there's no class String, only two redef class String statements in environ.nit and file.nit
Alexis Laferrière
@xymus
String is introduced in lib/core/text/abstract_text.nit
Jake Russo
@MadcapJake
ohh, i was missing the abstract keyword in my grep, thanks!
Jake Russo
@MadcapJake
This is what I have for interfaces/classes in lib/core:
AbstractArray|AbstractArrayRead|Array|ArrayCmp|ArrayMap|ArraySet|
BM_Pattern|Bool|Buffer|BufferedReader|Byte|BytePattern|Bytes|
CachedAlphaComparator|Char|CircularArray|Cloneable|Coder|Collection|
Comparable|Comparator|Couple|CoupleMap|Decoder|DefaultComparator|
DefaultReverseComparator|Discrete|DisjointSet|Duplex|Error|FileReader|
FileStat|FileStream|FileWriter|Finalizable|FinalizableOnce|FlatBuffer|
FlatString|FlatText|Float|HashMap|HashSet|IndexedIterator|Int|IOError|
ISODate|Iterator|IteratorDecorator|LineIterator|List|ListIterator|Map|
MapComparator|MapIterator|MapKeysIterator|MapRead|MapValuesIterator|
Match|MaybeError|MinHeap|NativeArray|NativeString|Numeric|Object|Path|
Pattern|PollableReader|Process|ProcessDuplex|ProcessReader|
ProcessWriter|Queue|Range|Reader|Ref|Regex|RemovableCollection|
RopeBuffer|RopeBufferByteIterator|RopeBufferByteReverseIterator|
RopeBufferBytes|RopeBufferCharIterator|RopeBufferCharReverseIterator|
RopeBufferChars|Sequence|SequenceRead|Set|SimpleCollection|Stderr|
Stdin|Stdout|Stream|String|StringReader|StringWriter|Sys|Task|Text|
Writable|Writer
Jake Russo
@MadcapJake
are the raw markup blocks (backtick{ ... backtick}) always C code?
Alexis Laferrière
@xymus
The language is declared by a in "Java" before the backtick {
there's C, C++, Java and ObjC
the default is C
Jake Russo
@MadcapJake
very cool!
Alexis Laferrière
@xymus
:wink:
Jake Russo
@MadcapJake
I'm working on language support for Atom Editor and I can have Atom highlight the code inside the backtick { as proper C/C++/Java/ObjC code
Jake Russo
@MadcapJake
I'm basically finished with this: https://atom.io/packages/language-nit
I still need to update the readme, add autoindent/autodedent, and folding rules. But otherwise, it's a working highlighter!
Beyond that, I can integrate into the atom linter and autocomplete plugins. And I have to learn more about building Nit projects but once I do, I could even integrate into the atom-build package!
Writing a text editor proved quite challenging in javascript, I do have some possible paths I could take to get it working but I think I'm more interested in getting solid Atom tooling support.
Alexis Laferrière
@xymus
Cool! nice work
Lucas Bajolet
@R4PaSs
Wow, nice !
Jake Russo
@MadcapJake
Thanks! Let me know what you think! Here's the main additions over Sublime-Nit:
  • outsourced highlighting of C/C++/ObjC/Java code
  • separate styling for redef, super, and a few others
  • core types all highlighted differently than defined/other types
  • method declaration highlighting
  • first line matching for shebangs
I've looked at some of the examples and it works well, except for one file that crashes Atom every time: perlin_noise.nit
Jean Privat
@privat
wow, this is great. What about adding it to http://nitlanguage.org/ide.html ?
Jake Russo
@MadcapJake
Ok I've added it: nitlang/nitlanguage#9
Jake Russo
@MadcapJake
How do you get to that page from the index of the wiki? I can't locate it.
Jake Russo
@MadcapJake
Oh found it, way at the bottom :)
Jake Russo
@MadcapJake
I added another reference to it on the doc page in nitlang/nitlanguage#10
Jake Russo
@MadcapJake

I have this as a list of top-level accessible functions:

sys|main|run|print|inf|nan|pi|srand_from|join_bytes|egid|euid|
gid|uid|args|program_args|program_name|utf8_coder|utf8_decoder|
get_time|nanosleep|getc|getcwd|gets|poll|print_error|printn|
stderr|stdin|stdout|system

is that accurate and did I miss any?

Jake Russo
@MadcapJake
Just trying to highlight builtin/top-level-available methods as support functions (this is common for syntax highlighters). That's why I'm trying to get a list of available functions and types at top-level
Also, for autocomplete support I'll need a big JSON list of these
Alexis Laferrière
@xymus
For highlighting I would stick to the basics: print, print_error, sys, args, program_name
top-level functions are nothing special in Nit
Jake Russo
@MadcapJake
ok good idea, just trying to figure out what's a good set of basics, thanks @xymus !
Jake Russo
@MadcapJake
are there anonymous functions in Nit?
also, can I store a function in a HashMap? If so, how do you signify the type?
Alexis Laferrière
@xymus
There's no anonymous functions in Nit, the closest thing are instances of Task
Jake Russo
@MadcapJake
ok so then I couldn't really store a function in a hashmap then, right?
Alexis Laferrière
@xymus
There are no functions by themselves or as objects, they would need a receiver, so the trick is to store subclasses of Task which implement the desired method.
Jake Russo
@MadcapJake
Any example of this somewhere? stdlib has very little to say about Task
Alexis Laferrière
@xymus
It's quite new, it is used mostly in parallel code to pass bits of code between threads.
I can't find a good example for your use case, the closest is for thread pools which internally keep an Array[Task]at lib/pthreads/examples/threadpool_example.nit
The idea is to subclass Task and implement main. You can store the arguments for the method and its return value as attributes of the class.
Jake Russo
@MadcapJake
But there's no way to dynamically change the body of main is there?
Alexis Laferrière
@xymus
Right, it's static
Jake Russo
@MadcapJake
I was just trying to see if anything from here could be implemented in Nit (as a solution to #1914 ) but without first-class functions, it's not really possible.
yc
@cloutiy
Hello, perhaps it's very obvious and I just missed it,but how does one get user input from the console?
DanitiKain
@DanitiKain
I get error when adding repo..
says its not signed correctly
Jean Privat
@privat
Hi. Can you be more specific about the issue?