Commit Graph

54 Commits

Author SHA1 Message Date
Jarred Sumner
2fc6913085 More assertions 2022-12-30 04:46:52 -08:00
Jarred Sumner
c0dd284136 Upgrade to latest Zig (#1610)
* @min and @max

* builtins and some trivial ones

* Most of them

* more

* more!

* More Progress

* wip

* Update tagged_pointer.zig

* Update http_client_async.zig

* Most of the iterable dir changes

* alright

* Remove usages of deprecated formatters

* 📷

* fmt

* Update shimmer.zig

* wip

* wip

* wip

* progress

* more

* Latest

* stuck on error

* latest

* workaround stage2

* wip

* Update string_immutable.zig

* wip

* Migrate `Dirent` and `require("fs')` to use JSC<>Zig bindings

* Fix build errors

* Fixup most of the test failures

* Fix `make headers`

* Fix "outside package path" error

* Fixup aligned alloc

* Add missing file

* linux

* More linux fixes

* use latest peechy

* Fix transpiler test failure

* Forgot about these

* Fixup test failure

* Update node-timers.test.ts

* [node:htt] Fix `undefined is not an object` error

Fixes https://github.com/oven-sh/bun/issues/1618

* Update http.exports.js

* Make this test less flaky

* fix hashes

* Fix hex formatting and zls issues

* Download zig version

* Update Dockerfile

* Update Dockerfile

* Update uws

* Update Dockerfile

* Set llvm version

* Update README.md

* Update uws

* Update Dockerfile

* Update io_linux.zig

* Update bun.zig

* Log output

* workaround strange @cInclude error

* Make ffi tests better

* Don't use cImport

* Update c.zig

* Update c-bindings.cpp

* call setOutputDir

* Update Dockerfile

* Use a longer name

* latest

* Update serve.test.ts

Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Co-authored-by: Veikka Tuominen <git@vexu.eu>
2022-12-28 00:51:22 -08:00
Jarred Sumner
b631ea7d72 import everything from "bun" where possible 2022-11-29 02:42:56 -08:00
Jarred Sumner
453eaf6871 Fix crash when parsing empty JSON file 2022-09-16 03:20:28 -07:00
Jarred Sumner
77a0f335cb wip ReadableStream for HTTP(s) Server 2022-06-26 06:01:22 -07:00
Jarred Sumner
d629cfafd6 E.String gets a Rope 2022-05-05 21:32:19 -07:00
Jarred Sumner
701d6ec45d rename _global -> bun 2022-03-08 18:54:54 -08:00
Jarred Sumner
51fbbea1d3 upgrade zig 2022-03-04 00:20:22 -08:00
Jarred Sumner
09146d1c11 Update json_parser.zig 2022-02-27 04:54:48 -08:00
Jarred Sumner
1ed74ab59b mark as comptime 2022-02-27 04:26:45 -08:00
Jarred Sumner
0a86a4ea80 Fix https://github.com/Jarred-Sumner/bun/issues/115 2022-02-27 04:14:55 -08:00
Jarred Sumner
8f1b2b2350 [JSON] Implement a way to convert any Zig type to a JSON object 2022-02-20 16:24:11 -08:00
Jarred Sumner
423d208790 [bun.js] Handle recursive macros and handle stack overflow 2022-02-14 19:03:25 -08:00
Jarred Sumner
3d057950b9 std.os.exit -> Global.exit so stderr is always flushed 2022-02-11 14:56:28 -08:00
Jarred Sumner
97d17904d3 Update AST layout to store capacity for items
We want to be able to push to the list
2022-01-28 19:26:03 -08:00
Jarred Sumner
5311219de7 dead code 2022-01-03 22:26:24 -08:00
Jarred Sumner
e75c711c68 Upgrade to latest Zig, remove dependency on patched version of Zig (#96)
* Prepare to upgrade zig

* zig fmt

* AllocGate

* Update data_url.zig

* wip

* few files

* just headers now?

* I think everything works?

* Update mimalloc

* Update hash_map.zig

* Perf improvements to compensate for Allocgate

* Bump

* 📷

* Update bun.lockb

* Less branching

* [js parser] Slightly reduce memory usage

* Update js_parser.zig

* WIP remove unused

* [JS parser] WIP support for `with` keyword

* Remove more dead code

* Fix all the build errors!

* cleanup

* Move `network_thread` up

* Bump peechy

* Update README.md
2021-12-30 21:12:32 -08:00
Jarred Sumner
336a4b6ac2 Prepare to run unit tests & remove some dead code (#92)
* Remove some dead code

* 💀 code

* Fix the zig tests

* [JS Printer] Print integers faster & less scientific notation on decimals

* 💀 dead code

* skip

* Run all the unit tests
2021-12-27 18:06:31 -08:00
Jarred Sumner
3036cbe552 bun add and bun remove sorta works now. but not fast enough! 2021-12-16 19:18:51 -08:00
Jarred Sumner
538243dc3b [bun install] Deterministic lockfile and simple installs 2021-12-16 19:18:51 -08:00
Jarred Sumner
9fcd2c53c8 [JSON parser] const has better codegen (unlike in JavaScript!) 2021-12-16 19:18:51 -08:00
Jarred Sumner
bd6b9a58d3 [internal] disable debug workaround 2021-12-16 00:44:39 -08:00
Jarred Sumner
04e0910dea Fix occasional segfault when parsing JSON in http server 2021-11-25 17:17:17 -08:00
Jarred Sumner
fe1a6cee10 [JSON Parser] Improve perf by 2%-4%
We warn when a JSON object has duplicate keys, but detecting duplicate keys has a cost. Now the hash table used for deduping keys is pooled instead of reallocated each time

This also removes a call to potentially resize object properties and arrays to their smallest possible size. Resizing an array can be expensive
2021-11-11 15:33:39 -08:00
Jarred Sumner
bc5f99dc43 [internal] Tiny changes that will eventually make it easier to update zig 2021-11-01 04:04:18 -07:00
Jarred Sumner
9e4f16ac8b ^ 2021-10-24 16:52:16 -07:00
Jarred Sumner
6f6510169e [JSON] Use a special lexer variant only for JSON 2021-10-24 16:09:15 -07:00
Jarred Sumner
ff01dfa03d When bundling JSON, only use JSON.parse when the input is ASCII.
We don't want to add an extra pass over the input to convert it to UTF16. And JS engines storing strings as UTF-16 is more expensive anyway, so the runtime win here probably isn't as big (though open to evidence to the contrary!)
2021-09-23 21:43:37 -07:00
Jarred Sumner
e869cdca9f Slightly improve .env loader string inference 2021-09-20 22:37:39 -07:00
Jarred Sumner
f4d1a3c33d Remove most usages of anytype in js_ast.zig 2021-09-15 21:29:20 -07:00
Jarred Sumner
fc907e2f81 current 2021-09-09 23:33:34 -07:00
Jarred Sumner
c20df72d73 more mutexes
Former-commit-id: 52966012b4b74d24ab28a0c75740aef35fb75327
2021-09-05 02:05:45 -07:00
Jarred Sumner
8c67007926 Use mimalloc for a 10% boost
Former-commit-id: 044e11d720bc6742dc53b30b4e88e8be7e76c419
2021-08-23 02:29:07 -07:00
Jarred Sumner
f96f299377 hash
Former-commit-id: b97aca7fa1
2021-06-06 21:16:50 -07:00
Jarred Sumner
87d01c9f4a Fix printing bugs
Former-commit-id: 52f37e4fe4
2021-05-30 23:35:43 -07:00
Jarred Sumner
4aee9094a7 detect JSON errors
Former-commit-id: 9b5f317c5b
2021-05-26 18:11:28 -07:00
Jarred Sumner
154e049638 lots
Former-commit-id: 9ccb4dd082
2021-05-16 23:25:12 -07:00
Jarred Sumner
e80f865974 lots
Former-commit-id: d8b1d29656
2021-05-15 17:23:55 -07:00
Jarred Sumner
bed0227a8f hm
Former-commit-id: 28fce4aac1
2021-05-13 00:46:22 -07:00
Jarred Sumner
c09d7cf839 That's all the errors??
Former-commit-id: f9a74df73d
2021-05-12 13:00:25 -07:00
Jarred Sumner
ae90b3deea Use try for errors during parsing so that backtracking can happen
Former-commit-id: 7d3b0e7daa
2021-05-08 20:48:20 -07:00
Jarred Sumner
fad34bb4ab cool
Former-commit-id: 96ff169e46
2021-05-07 01:26:26 -07:00
Jarred Sumner
41c9896e11 I think that fixes the scopes bug
Former-commit-id: 2cbd4c9d80
2021-05-05 19:02:14 -07:00
Jarred Sumner
6be0a4653f damn tho
Former-commit-id: e1df98878d
2021-05-05 03:09:59 -07:00
Jarred Sumner
ed9981c9c6 re
Former-commit-id: 2e8d6d549d
2021-05-04 16:02:09 -07:00
Jarred Sumner
adc4e9b23c *
Former-commit-id: 4c60accdc1
2021-05-04 16:01:21 -07:00
Jarred Sumner
cabe773a4f wip
Former-commit-id: b37acf309c
2021-04-28 21:58:02 -07:00
Jarred Sumner
02fbb8e82a json works in CLI sort of 2021-04-27 12:00:10 -07:00
Jarred Sumner
70b6f889c7 lots 2021-04-26 19:22:17 -07:00
Jarred Sumner
97ce2513dc strings kind of 2021-04-26 10:28:48 -07:00