Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Compatibility: unary negation of 0.0 loses negative zero versus purs

Chiusa
#614 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Documentazione
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
node.js, rust

Direzione di ricerca

Start by reviewing PR #474 and the reported unary-negation lowering and constant-folding behavior. Run the standalone Spago reproducer to compare signed-zero results between purs and Iris. Done means documenting the chosen compatibility contract and adding the small regression test if deliberate divergence is retained.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

This is a documented runtime divergence, not yet a compiler-bug claim. With purs 0.15.15, Iris 0.1.1, Node 22.16.0 and registry set 81.1.0, a valid Number expression involving (-0.0) differs after unary negation is lowered. The signed-zero choice appears intentional in merged PR #474, which emits 0 - value and folds the negative-zero literal to positive zero. This issue asks that the compatibility contract be decided/documented, rather than presupposing the implementation must be changed.

Standalone observation (a fresh Spago package with prelude, effect, console, and argonaut-core dependencies; workspace.packageSet.registry: 81.1.0):

module Main where

import Prelude
import Data.Argonaut.Core as J
import Effect (Effect)
import Effect.Console (log)

main :: Effect Unit
main = log (show (map (1.0 / _) (J.toNumber (J.fromNumber (-0.0)))))

Purs prints (Just -Infinity); Iris 0.1.1 prints (Just Infinity). This is not JSON serialization: JSON.stringify(-0) is "0" on either side. In the generated caller, purs passes -0.0 to fromNumber, whereas Iris passes 0; both package paths use the same identity fromNumber FFI. The reciprocal merely exposes the zero sign observably.

The outcome may be an intentional interpretation of PureScript numeric negation rather than an Iris defect. What observable signed-zero behavior should Iris promise relative to purs for unary negation and constant folding? If deliberate divergence is supported, documenting it with a small regression test would let downstream users reason about it. No private repository link or fixture is required for the reproducer.

Lingua principale
Rust
Stelle
117
Fork
11
Merge medio
4h 22m
PR unite (30g)
126

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di purefunctor/purescript-iris

Tutte le issue di purefunctor/purescript-iris

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.