Code Monkey home page Code Monkey logo

crow's Issues

Better navigation for documentation modules

At https://crow-lang.org/doc, the left navigation bar has a line for every module in the standard library. This makes the page too tall.

I think the solution is to have a collapsed section for each directory (probably using details).
I'm ambivalent about whethere there is recursive nesting where crow/io/net/ goes inside crow/io/, or if it's just its own section.

Compile error on "\0" in string literals

There should be a compile error if \0 occurs in a string literal, as in "foo\0bar". (The reason: this has the same effect as just writing "foo".)
This should not apply to a character literal (which also looks like "\0").

Ignore extra slash in path parsing

crow run demo/sdl//main.crow should work the same as crow run demo/sdl/main.crow. Since other tools like cat ignore the double slash.

`make all` results in error `scope variable ``writer`` assigned to non-scope parameter ``writer`` calling util.writer.finishWriterToSafeCStr`

Describe problem
Can't build the crow website. During build scope variable ``writer`` assigned to non-scope parameter ``writer`` calling util.writer.finishWriterToSafeCStr error occurs in src/interpret/runBytecode.d(319) file

Expected behavior
Website builds and serves

Actual behavior
Website fails to build

Steps to reproduce

  1. Clone the repo
  2. Install dependencies as per readme.md (ldc,dmd,hg)
  3. run make all

Additional info
System: Arch linux
Kernel: 5.16.15

Build log
rm -rf bin site temp
mkdir -p bin/d-imports
date --iso-8601 --utc > bin/d-imports/date.txt
mkdir -p bin/d-imports
git rev-parse --short HEAD > bin/d-imports/commit-hash.txt
hg clone https://dyncall.org/pub/dyncall/dyncall/
destination directory: dyncall
requesting all changes
adding changesets
adding manifests
adding file changes
added 468 changesets with 2242 changes to 724 files                                                                                                                                            
new changesets 3e629dc19168:b47168dacba6
updating to branch default
582 files updated, 0 files merged, 0 files removed, 0 files unresolved
cd dyncall && ./configure
Configuration written to Makefile.config
cd dyncall && make
make[1]: Entering directory '/home/boris/Desktop/crow/dyncall'
cd dyncall && make all
make[2]: Entering directory '/home/boris/Desktop/crow/dyncall/dyncall'
cc -fPIC   -c -o dyncall_vector.o dyncall_vector.c
cc -fPIC   -c -o dyncall_api.o dyncall_api.c
cc -fPIC   -c -o dyncall_callvm.o dyncall_callvm.c
cc -fPIC   -c -o dyncall_callvm_base.o dyncall_callvm_base.c
cc    -c -o dyncall_call.o dyncall_call.S
cc -fPIC   -c -o dyncall_callf.o dyncall_callf.c
cc -fPIC   -c -o dyncall_struct.o dyncall_struct.c
ar rv libdyncall_s.a dyncall_vector.o dyncall_api.o dyncall_callvm.o dyncall_callvm_base.o dyncall_call.o dyncall_callf.o dyncall_struct.o
ar: creating libdyncall_s.a
a - dyncall_vector.o
a - dyncall_api.o
a - dyncall_callvm.o
a - dyncall_callvm_base.o
a - dyncall_call.o
a - dyncall_callf.o
a - dyncall_struct.o
make[2]: Leaving directory '/home/boris/Desktop/crow/dyncall/dyncall'
cd dyncallback && make all
make[2]: Entering directory '/home/boris/Desktop/crow/dyncall/dyncallback'
cc -fPIC -I/home/boris/Desktop/crow/dyncall/./dyncallback/../dyncall    -c -o dyncall_alloc_wx.o dyncall_alloc_wx.c
cc -fPIC -I/home/boris/Desktop/crow/dyncall/./dyncallback/../dyncall    -c -o dyncall_args.o dyncall_args.c
cc -fPIC -I/home/boris/Desktop/crow/dyncall/./dyncallback/../dyncall    -c -o dyncall_callback.o dyncall_callback.c
cc    -c -o dyncall_callback_arch.o dyncall_callback_arch.S
cc -fPIC -I/home/boris/Desktop/crow/dyncall/./dyncallback/../dyncall    -c -o dyncall_thunk.o dyncall_thunk.c
ar rv libdyncallback_s.a dyncall_alloc_wx.o dyncall_args.o dyncall_callback.o dyncall_callback_arch.o dyncall_thunk.o
ar: creating libdyncallback_s.a
a - dyncall_alloc_wx.o
a - dyncall_args.o
a - dyncall_callback.o
a - dyncall_callback_arch.o
a - dyncall_thunk.o
make[2]: Leaving directory '/home/boris/Desktop/crow/dyncall/dyncallback'
cd dynload && make all
make[2]: Entering directory '/home/boris/Desktop/crow/dyncall/dynload'
cc -fPIC   -c -o dynload.o dynload.c
cc -fPIC   -c -o dynload_syms.o dynload_syms.c
ar rv libdynload_s.a dynload.o dynload_syms.o
ar: creating libdynload_s.a
a - dynload.o
a - dynload_syms.o
make[2]: Leaving directory '/home/boris/Desktop/crow/dyncall/dynload'
make[1]: Leaving directory '/home/boris/Desktop/crow/dyncall'
dmd -ofbin/crow-debug -betterC -preview=dip25 -preview=dip1000 -J=bin/d-imports -check=on -boundscheck=on -debug -g -version=Debug -version=Test src/app.d src/concretize/*.d src/frontend/*.d src/frontend/*/*.d src/interpret/*.d src/lib/*.d src/lower/*.d src/model/*.d src/util/*.d src/util/*/*.d src/backend/*.d src/document/*.d src/test/*.d -L=-ldyncall_s -L=-L./dyncall/dyncall -L=-lgccjit
src/interpret/runBytecode.d(319): Error: scope variable `writer` assigned to non-scope parameter `writer` calling util.writer.finishWriterToSafeCStr
src/interpret/runBytecode.d(332): Error: scope variable `writer` assigned to non-scope parameter `writer` calling util.writer.finishWriterToSafeCStr
make: *** [Makefile:78: bin/crow-debug] Error 1

If comment out lines that result in error, another error occurs:

/usr/bin/ld: cannot find -lgccjit
collect2: error: ld returned 1 exit status
Error: linker exited with status 1

After lgccjit installation another error occurs:

cannot find program `wasm-ld`

After wasm-ld installation another error occurs ./readme.md line 1 is 164 columns long, should be <= 120
After installing missing dependencies and uncommenting commented lines the error scope variable ``writer`` assigned to non-scope parameter ``writer`` calling is still present

After removing first line of readme.md and commenting out src/interpret/runBytecode.d(332): it finally starts.

SQLite support

demo/db.crow uses LMDB. That was easy to port to crow due to having a simple API, but it's not as popular as SQLite, so it would be nice to have an SQLite demo too.

The task would be to write a simple program like demo/db.crow that uses SQLite instead of LMDB. This would involve:

  • Transcribing needed parts of /usr/include/sqlite3.h to a new file in this repository, include/sqlite3.crow.
  • Writing a wrapper library include/crow/db/sqlite3.crow; compared to the underlying include/sqlite3.crow, this should be safe, and use crow types like str instead of C-like types like char*.
  • Write demo/sqlite.crow to show off the library.

Write a heap data structure

Same interface as mut-priority-queue, but using a heap instead. See if performance is better than mut-priority-queue.

Add search bar for documentation

Here's how I think this could be implemented:

  • Modify site-src/document-content.crow to provide an ID for each function/type/spec, so that a link can refer to the particular function. E.g.: /doc/crow/compare.html#equal.

    • It's not important to distinguish overloads (or a type and function having the same name) since they should be close together anyway
  • Modify site-src/document.crow walk over all-modules and collect search terms.

    • See module.crow for the type definition of a module. Just walk over the tree that represents a module and collect search terms.
    • Split doc comments into words to get search terms. script/lint.crow already has a function for parsing words, so that could go in a module shared by both script/lint.crow and the new code.
    • Omit common words like "the" from the search terms.
  • Store the search terms in a file doc/search.json (exact format can be whatever). Load that in the browser and use that to implement a search box.

    • Put this at the top of the navigation pane on the left.
    • Based on a brief search fuse.js seems to implement this kind of functionality. Other libraries could be used.
  • An alternative would be to use the results of crow doc directly. The script site-src/site.crow starts by running a crow doc command. This generates 539KB of data though; it includes things like parameter information that isn't relevant for search. I think if we parse out the search terms ahead of time we can get a smaller format.

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.