summaryrefslogtreecommitdiff
path: root/libraries
Commit message (Collapse)AuthorAgeFilesLines
* JS: fix getpid (fix #23399)Sylvain Henry2023-05-164-1/+12
|
* JS: Implement h$clock_gettime in the JavaScript RTS (#23360)Josh Meredith2023-05-161-1/+1
|
* base: Introduce printToHandleFinalizerExceptionHandlerBen Gamari2023-05-167-3/+31
|
* base: Export {get,set}ExceptionFinalizer from System.Mem.WeakBen Gamari2023-05-162-0/+10
| | | | | | As proposed in CLC Proposal #126 [1]. [1]: https://github.com/haskell/core-libraries-committee/issues/126
* Use unboxed codebuffers in baseJosh Meredith2023-05-159-493/+597
| | | | | Metric Decrease: encodingAllocations
* Replace the implementation of CodeBuffers with unboxed typesJosh Meredith2023-05-151-11/+50
|
* Fix GHCJS OS platform (fix #23346)Sylvain Henry2023-05-151-0/+2
|
* Add more instances for Compose: Enum, Bounded, Num, Real, IntegralBodigrim2023-05-132-0/+12
| | | | See https://github.com/haskell/core-libraries-committee/issues/160 for discussion
* Mention new implementation of GHC.IORef.atomicSwapIORef in the changelogwip/T23333Bodigrim2023-05-121-0/+1
|
* Add fused multiply-add instructionssheaf2023-05-111-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds eight new primops that fuse a multiplication and an addition or subtraction: - `{fmadd,fmsub,fnmadd,fnmsub}{Float,Double}#` fmadd x y z is x * y + z, computed with a single rounding step. This patch implements code generation for these primops in the following backends: - X86, AArch64 and PowerPC NCG, - LLVM - C WASM uses the C implementation. The primops are unsupported in the JavaScript backend. The following constant folding rules are also provided: - compute a * b + c when a, b, c are all literals, - x * y + 0 ==> x * y, - ±1 * y + z ==> z ± y and x * ±1 + z ==> z ± x. NB: the constant folding rules incorrectly handle signed zero. This is a known limitation with GHC's floating-point constant folding rules (#21227), which we hope to resolve in the future.
* Document unlawfulness of instance Num FixedBodigrim2023-05-112-2/+9
| | | | Fixes #22712
* base: Export GHC.Conc.Sync.fromThreadIdBen Gamari2023-05-112-1/+10
| | | | Closes #22706.
* ghc-prim: Generalize keepAlive#/touch# in state token typeBen Gamari2023-05-101-0/+2
| | | | Closes #23163.
* Make `(&)` representation polymorphic in the return typekonsumlamm2023-05-092-4/+7
|
* compiler: Implement atomicSwapIORef with xchgBen Gamari2023-05-091-6/+1
| | | | As requested by @treeowl in CLC#139.
* testsuite: Add test for atomicSwapIORefBen Gamari2023-05-093-0/+14
|
* Use TemplateHaskellQuotes in TH.Syntax to construct NamesOleg Grenrus2023-05-051-25/+14
|
* Improved documentation for the Data.OldList.nub functionAndrei Borzenkov2023-05-041-3/+9
| | | | | | There was recomentation to use map head . group . sort instead of nub function, but containers library has more suitable and efficient analogue
* base/encoding: add an allocations performance test (#22946)Josh Meredith2023-05-042-0/+39
|
* Fix remaining issues with bound checking (#23123)Sylvain Henry2023-05-041-2/+1
| | | | | | | | | | | | | | | | | | | | While fixing these I've also changed the way we store addresses into ByteArray#. Addr# are composed of two parts: a JavaScript array and an offset (32-bit number). Suppose we want to store an Addr# in a ByteArray# foo at offset i. Before this patch, we were storing both fields as a tuple in the "arr" array field: foo.arr[i] = [addr_arr, addr_offset]; Now we only store the array part in the "arr" field and the offset directly in the array: foo.dv.setInt32(i, addr_offset): foo.arr[i] = addr_arr; It avoids wasting space for the tuple.
* Bump Cabal submodule (#22356)Sylvain Henry2023-05-031-0/+0
|
* Document instances of DoubleBodigrim2023-05-032-28/+94
|
* Add sized primitive literal syntaxBen Orchard2023-05-031-0/+1
| | | | | | | | | | | | | | Adds a new LANGUAGE pragma ExtendedLiterals, which enables defining unboxed numeric literals such as `0xFF#Word8 :: Word8#`. Implements GHC proposal 0451: https://github.com/ghc-proposals/ghc-proposals/blob/b384a538b34f79d18a0201455b7b3c473bc8c936/proposals/0451-sized-literals.rst Fixes #21422. Bumps haddock submodule. Co-authored-by: Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io>
* Add the Unsatisfiable classsheaf2023-04-292-10/+69
| | | | | | | | | This commit implements GHC proposal #433, adding the Unsatisfiable class to the GHC.TypeError module. This provides an alternative to TypeError for which error reporting is more predictable: we report it when we are reporting unsolved Wanted constraints. Fixes #14983 #16249 #16906 #18310 #20835
* testsuite: wasm32-specific fixesCheng Shao2023-04-273-7/+13
| | | | This patch includes all wasm32-specific testsuite fixes.
* testsuite: add the req_process predicateCheng Shao2023-04-275-7/+9
| | | | | | This patch adds the req_process predicate to the testsuite to assert the platform has a process model, also marking tests that involve spawning processes as req_process. Also bumps hpc & process submodule.
* JS: Fix h$base_access implementation (issue 22576)Josh Meredith2023-04-251-3/+3
|
* JS/base: provide implementation for mkdir (issue 22374)Josh Meredith2023-04-254-1/+30
|
* Add since pragma to Data.Functor.unzipBodigrim2023-04-241-1/+4
|
* rts: always build 64-bit atomic opsCheng Shao2023-04-241-22/+4
| | | | | | | | | | This patch does a few things: - Always build 64-bit atomic ops in rts/ghc-prim, even on 32-bit platforms - Remove legacy "64bit" cabal flag of rts package - Fix hs_xchg64 function prototype for 32-bit platforms - Fix AtomicFetch test for wasm32
* Fix doc typos in libraries/basetocic2023-04-237-9/+9
|
* Implement executablePath for Solaris and make getBaseDir less platform-dependentPHO2023-04-233-19/+50
| | | | | | | | | | Use base-4.17 executablePath when possible, and fall back on getExecutablePath when it's not available. The sole reason why getBaseDir had #ifdef's was apparently that getExecutablePath wasn't reliable, and we could reduce the number of CPP conditionals by making use of executablePath instead. Also export executablePath on js_HOST_ARCH.
* Fix doc typos in libraries/base/GHCtocic2023-04-216-8/+8
|
* Implement -jsem: parallelism controlled by semaphoressheaf2023-04-201-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | See https://github.com/ghc-proposals/ghc-proposals/pull/540/ for a complete description for the motivation for this feature. The `-jsem` option allows a build tool to pass a semaphore to GHC which GHC can use in order to control how much parallelism it requests. GHC itself acts as a client in the GHC jobserver protocol. ``` GHC Jobserver Protocol ~~~~~~~~~~~~~~~~~~~~~~ This proposal introduces the GHC Jobserver Protocol. This protocol allows a server to dynamically invoke many instances of a client process, while restricting all of those instances to use no more than <n> capabilities. This is achieved by coordination over a system semaphore (either a POSIX semaphore [6]_ in the case of Linux and Darwin, or a Win32 semaphore [7]_ in the case of Windows platforms). There are two kinds of participants in the GHC Jobserver protocol: - The *jobserver* creates a system semaphore with a certain number of available tokens. Each time the jobserver wants to spawn a new jobclient subprocess, it **must** first acquire a single token from the semaphore, before spawning the subprocess. This token **must** be released once the subprocess terminates. Once work is finished, the jobserver **must** destroy the semaphore it created. - A *jobclient* is a subprocess spawned by the jobserver or another jobclient. Each jobclient starts with one available token (its *implicit token*, which was acquired by the parent which spawned it), and can request more tokens through the Jobserver Protocol by waiting on the semaphore. Each time a jobclient wants to spawn a new jobclient subprocess, it **must** pass on a single token to the child jobclient. This token can either be the jobclient's implicit token, or another token which the jobclient acquired from the semaphore. Each jobclient **must** release exactly as many tokens as it has acquired from the semaphore (this does not include the implicit tokens). ``` Build tools such as cabal act as jobservers in the protocol and are responsibile for correctly creating, cleaning up and managing the semaphore. Adds a new submodule (semaphore-compat) for managing and interacting with semaphores in a cross-platform way. Fixes #19349
* Fix doc typo in GHC.Read.readListtocic2023-04-201-2/+2
|
* JS: fix thread-related primopsSylvain Henry2023-04-193-1/+9
|
* Misc cleanupKrzysztof Gogolewski2023-04-175-5/+4
| | | | | | - Use dedicated list functions - Make cloneBndrs and cloneRecIdBndrs monadic - Fix invalid haddock comments in libraries/base
* docs: Update template-haskell docs to use Code Q a rather than Q (TExp a)Matthew Pickering2023-04-151-37/+41
| | | | | | | | Since GHC Proposal #195, the type of [|| ... ||] has been Code Q a rather than Q (TExp a). The documentation in the `template-haskell` library wasn't updated to reflect this change. Fixes #23148
* Base/JS: GHC.JS.Foreign.Callback module (issue 23126)Josh Meredith2023-04-133-4/+153
| | | | | | | | | | | | | * Add the Callback module for "exporting" Haskell functions to be available to plain JavaScript code * Fix some primitives defined in GHC.JS.Prim * Add a JavaScript section to the user guide with instructions on how to use the JavaScript FFI, building up to using Callbacks to interact with the browser * Add tests for the JavaScript FFI and Callbacks
* Allow generation of TTH syntax with THOleg Grenrus2023-04-125-1/+15
| | | | | | | | | | | | | | | | | | | | In other words allow generation of typed splices and brackets with Untyped Template Haskell. That is useful in cases where a library is build with TTH in mind, but we still want to generate some auxiliary declarations, where TTH cannot help us, but untyped TH can. Such example is e.g. `staged-sop` which works with TTH, but we would like to derive `Generic` declarations with TH. An alternative approach is to use `unsafeCodeCoerce`, but then the derived `Generic` instances would be type-checked only at use sites, i.e. much later. Also `-ddump-splices` output is quite ugly: user-written instances would use TTH brackets, not `unsafeCodeCoerce`. This commit doesn't allow generating of untyped template splices and brackets with untyped TH, as I don't know why one would want to do that (instead of merging the splices, e.g.)
* Set base 'maintainer' field to CLCBodigrim2023-04-111-2/+2
|
* Adjust wording wrt representation polymorphism of ($)Sebastian Graf2023-04-071-1/+1
|
* Remove trailing whitespace from ($) commentaryAlex Dixon2023-04-071-3/+3
|
* Improve documentation for ($) (#22963)Alex Dixon2023-04-071-12/+63
|
* Add release note for GHC.Unicode refactor in base-4.18.Pierre Le Marre2023-04-061-3/+4
| | | | | Also merge CLC proposal 130 in base-4.19 with CLC proposal 59 in base-4.18 and add proper release date.
* GHCi.RemoteTypes: fix doc and avoid unsafeCoerce (#23201)Sylvain Henry2023-04-041-22/+43
|
* Add a few more memcpy-ish primopsMatthew Craven2023-04-043-25/+21
| | | | | | | | | | | | | | | | * copyMutableByteArrayNonOverlapping# * copyAddrToAddr# * copyAddrToAddrNonOverlapping# * setAddrRange# The implementations of copyBytes, moveBytes, and fillBytes in base:Foreign.Marshal.Utils now use these new primops, which can cause us to work a bit harder generating code for them, resulting in the metric increase in T21839c observed by CI on some architectures. But in exchange, we get better code! Metric Increase: T21839c
* Fixes around unsafeCoerce#Krzysztof Gogolewski2023-04-031-5/+25
| | | | | | | | | | | | 1. `unsafeCoerce#` was documented in `GHC.Prim`. But since the overhaul in 74ad75e87317, `unsafeCoerce#` is no longer defined there. I've combined the documentation in `GHC.Prim` with the `Unsafe.Coerce` module. 2. The documentation of `unsafeCoerce#` stated that you should not cast a function to an algebraic type, even if you later cast it back before applying it. But ghci was doing that type of cast, as can be seen with 'ghci -ddump-ds' and typing 'x = not'. I've changed it to use Any following the documentation.
* JS: fix issues with FD api supportSylvain Henry2023-04-032-2/+11
| | | | | | | | - Add missing implementations for fcntl_read/write/lock - Fix fdGetMode These were found while implementing TH in !9779. These functions must be used somehow by the external interpreter code.
* ghc-heap: remove wrong Addr# coercion (#23181)Sylvain Henry2023-04-033-4/+5
| | | | Conversion from Addr# to I# isn't correct with the JS backend.