Repository navigation
v0.3.9
Tooling
hive install <entrypoint.hive>builds a program and puts it where a shell finds commands:~/.local/binon Linux and macOS, and on Windows%LOCALAPPDATA%\Programs\Hive\bin, put on the user'sPATHthe first time.--nameinstalls it under another name.hive install --desktopadds a windowed program to the system's app launcher, with its icon, on Linux, macOS and Windows.hive install --target android/arm64installs the program as an app on a phone connected over USB, throughadb.
The terminal
hive.term.printends no line, andhive.term.printlnis the one that does, so a prompt or an escape sequence is written as it is.- A terminal is read a key at a time:
rawstops the echo and the line buffering,readKeyanswers each key named ashive.uinames it and a paste as one, andsizemeasures the window. - Raw mode is put back however a program ends:
mainreturning, a panic,hive.term.exit, or its last window closing. - A Windows console paints the escape sequences a program prints, as every other terminal does.
hive.term.startruns a program alongside this one: its output read while it runs, its input written, andprocessKillstopping it with everything it started; whatever is left is stopped when this program ends.
Command-line flags
hive.term.flags()is the program's arguments as one linehive.term.codec()reads back word for word, a word holding a space or a quote quoted again;join(hive.term.args(), " ")split such a word in two.- A flag takes a short name:
-- Flag as background-task bg;reads-bgas well as--background-task, the shorter of the two names being the short one. hive.term.positional(line)answers with a command line's own words: those before the first flag, and everything after a lone--.- The flag codec pairs words knowing the type: a
Booltakes the next word only when it istrueorfalse, and a negative number is a value, never a flag.
Files, pictures and HTTP
hive.net.httpOpenreads a response as it arrives: it answers once the headers are in,httpReceiveLineandhttpReceivehand the body over piece by piece, andhttpClosedrops the connection, which is what stops a model generating.hive.imagereads PNG, JPEG, GIF and WebP pictures into their pixels, andscaleresizes one.hive.filesays where the program is:workingDirectory,home,executable, andisDirbesideexists.hive.file.assetreads the program's ownassets/folder out of its executable, which is built in whenever a program reads it, window or none.
Windows and pages
hive.uilays out grids and stacks:gridwithcolumnsandspan,stackwithplace, a row thatwraps, andminWidth,maxWidth,minHeight,maxHeightandaspecton any box.- Text takes a weight, a slant and a length:
weight,italic,mono,linesending in an ellipsis,justifyacross a text's lines, andparagraphfor words in several styles wrapped as one. radio,choices,tabs,treeandprogressare widgets, the first four heard throughonChoose,onandonToggle.- Any widget hears the pointer and the focus:
onEnter,onLeave,onPress,onPoint,onRelease,onWheel,onFocus,onBlur,onScrollandonSize;carryandonDropdrag one onto another, andonFilehears a file chosen or dropped. - A box looks more ways:
gradient,opacity,shadow,easeto bring a change in over time, andfitfor a picture. limitssets a slider's or a number's range and step, andInputKindaddsTime,DateTime,Email,Tel,Url,ColorandFile.Iconhas 320, drawn from Lucide alike on a page and in a window.- A canvas draws more:
oval,arc,wedge,curve,cutout,symbol,picture, anedge, adashand agradient, andmeasuresays how widewordswill be everywhere.
Scenes
- A scene has more shapes:
torus,capsule,disc,mesh,tube,extrude,lathe,cloud,model,sign,group, and alinewiththick. - A shape says how it shines:
rough,metal,glow,unlit,wire,shadows, and atextureandreliefof its own laid bytile;scalesizes every shape. - A scene's light is the program's:
lamp,spot,sunlight,ambient, apanorama, and abackgroundwith no alpha to see through. - The camera can
orbit, looktowarda place,roll, goorthoand set itsdepth. - A scene says what is under the pointer through
onHitandonOver, and hands over a PNG of itself throughsnapshotandonSnapshot. - A
modelorfigureplays its file's animations withplay(clip, at, loop), and a glTF without a skin, or with many meshes, is drawn whole.
Fixes
onDragreaches a scene on a page, where the picture drawn over the scene took the press.- Writing an element inside a branch or a loop keeps what was proved about its vector:
t[k] = 1in an innerifcost the outert bounds k, which a write cannot change. - A proof is lost when what it was about is replaced: an
indexOfover a vector since rebound, and a guard ongrid[0]aftergrid[0] = [1], still proved an index that could be out of range.
Breaking
| was | is |
|---|---|
| an index proved for a vector, or for a row, used after the vector or a row of it is written | guarded again after the write: writing grid[1] costs the proofs about every row of grid |
hive.term.print(text) ending its line |
hive.term.println(text) |
--verbose file.txt, an error about file.txt |
file.txt is a word, and words go before the flags or after -- |
| a flag the type does not declare, or a word between the flags, passed over | a FlagError |
a value opening with a dash, --name -x |
--name=-x, or quoted |
To bootstrap from this release, seed/pinned.txt becomes:
tag: v0.3.9
asset: hivec-linux-amd64
sha256: 6c18e273040c5ec34de1f1cd07e3131396b9969e4bb0a829ec1e2fadfb0b0ce2