# Users

**URL:** https://chapel.discourse.group/c/users/6.md

[Latest](https://chapel.discourse.group/latest.md) · [Categories](https://chapel.discourse.group/categories.md)

---

## [About the Chapel Users category](https://chapel.discourse.group/t/about-the-chapel-users-category/38)

<div class="topic-metadata">

**Author:** [@bradcray](https://chapel.discourse.group/u/bradcray)\
**Replies:** 0

</div>

A category for discussing uses of the Chapel language—programming with it and utilizing its compiler and tools. Chapel programmers, whether expert or new to the language, can use this category to ask questions, exchange…

---

## [16 bit real numbers or 128 bit real numbers - Place Holder](https://chapel.discourse.group/t/16-bit-real-numbers-or-128-bit-real-numbers-place-holder/33551)

<div class="topic-metadata">

**Author:** [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Replies:** 11\
**Last updated:** [September 21, 2026, 2:17am UTC](https://chapel.discourse.group/t/16-bit-real-numbers-or-128-bit-real-numbers-place-holder/33551 "2026-09-21T02:17:45Z")

</div>

128-bit as something more accurate than 64-bit. Assume underlying hardware support. These can be fudged with 80-bit reals. I would run a mile from double/double. 16-bit for use with AI/ML applications or more. Assume un…

---

## [How to return multiple dynamic arrays](https://chapel.discourse.group/t/how-to-return-multiple-dynamic-arrays/51250)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 3\
**Last updated:** [August 7, 2026, 8:40pm UTC](https://chapel.discourse.group/t/how-to-return-multiple-dynamic-arrays/51250 "2026-08-07T20:40:46Z")

</div>

I need to define a function of the form proc foo(args : type) : (\[?D1\] int, \[?D2\] int) { ... return (a1, a2); } Chapel complains about the return type. Removing the return type works. This is not great for readabil…

---

## [Array of wrapped dynamic arrays](https://chapel.discourse.group/t/array-of-wrapped-dynamic-arrays/51254)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 8\
**Last updated:** [August 6, 2026, 3:50pm UTC](https://chapel.discourse.group/t/array-of-wrapped-dynamic-arrays/51254 "2026-08-06T15:50:55Z")

</div>

I need an array of dynamic arrays. So I have something like: record wrpd { const tsz : uint; const arr : \[0..#10, 0..#tsz, 0..#tsz\] uint } var A : \[1..#32\] wrpd; const T : uint = 3; const b : \[0..#10, 0..#T, 0..#T\]…

---

## [Omp critical](https://chapel.discourse.group/t/omp-critical/50488)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 3\
**Last updated:** [June 27, 2026, 3:28pm UTC](https://chapel.discourse.group/t/omp-critical/50488 "2026-06-27T15:28:07Z")

</div>

According to Gemini the equivalent of #pragma omp critical is: var myLock: sync bool; // Lock variable forall i in 1..10 { sync myLock { // Critical section: only one task executes this block at a time writeln…

---

## [Possible compiler bug with iterator](https://chapel.discourse.group/t/possible-compiler-bug-with-iterator/50071)

<div class="topic-metadata">

**Author:** [@nelsonluisdias](https://chapel.discourse.group/u/nelsonluisdias)\
**Replies:** 2\
**Last updated:** [June 2, 2026, 9:50pm UTC](https://chapel.discourse.group/t/possible-compiler-bug-with-iterator/50071 "2026-06-02T21:50:36Z")

</div>

The program below, iter stoi(const in s: \[\] string): int { for scol in s do { yield scol:int; } } var choice = "3,5"; var fruit = \["Apples", "Bananas", "Oranges", "Peaches", "Pineapples", "Figs"\]; var scols …

---

## [Blatant return error confuses compiler](https://chapel.discourse.group/t/blatant-return-error-confuses-compiler/49881)

<div class="topic-metadata">

**Author:** [@nelsonluisdias](https://chapel.discourse.group/u/nelsonluisdias)\
**Replies:** 8\
**Last updated:** [May 27, 2026, 11:14pm UTC](https://chapel.discourse.group/t/blatant-return-error-confuses-compiler/49881 "2026-05-27T23:14:11Z")

</div>

The following (wrong!) code var ax: \[1..10\] real = 1.0; var yc = wrong(ax); proc wrong( const in ax: \[\] real ): real where (ax.rank == 1): real { return 0.0; } has a blatant error: there should not be a " :…

---

## [Chapel 2.8 infinite loop](https://chapel.discourse.group/t/chapel-2-8-infinite-loop/49461)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 2\
**Last updated:** [May 11, 2026, 6:56pm UTC](https://chapel.discourse.group/t/chapel-2-8-infinite-loop/49461 "2026-05-11T18:56:39Z")

</div>

Is it just me or is anybody else frequently seeing chapel 2.8 going into infinite loops? I see different patterns at different times. Once it was because of a pattern like this: const ref xt : \[0..#H, 0..#W\] real( 32 …

---

## [Chpldoc - include submodule documentation in main module, hide elsewhere?](https://chapel.discourse.group/t/chpldoc-include-submodule-documentation-in-main-module-hide-elsewhere/48711)

<div class="topic-metadata">

**Author:** [@jmag722](https://chapel.discourse.group/u/jmag722)\
**Replies:** 7\
**Last updated:** [May 5, 2026, 12:03am UTC](https://chapel.discourse.group/t/chpldoc-include-submodule-documentation-in-main-module-hide-elsewhere/48711 "2026-05-05T00:03:56Z")

</div>

Hello, I have a module Bar that includes submodules to avoid excessive nesting in the import/use statement, but still allowing the implementations to reside in separate files. The submodule really only exists to contain…

---

## [Writing numbers with small exponential](https://chapel.discourse.group/t/writing-numbers-with-small-exponential/48968)

<div class="topic-metadata">

**Author:** [@cpraveen](https://chapel.discourse.group/u/cpraveen)\
**Replies:** 6\
**Last updated:** [April 30, 2026, 6:47am UTC](https://chapel.discourse.group/t/writing-numbers-with-small-exponential/48968 "2026-04-30T06:47:45Z")

</div>

Sometimes my code generates numbers like 1e-311 which is smaller than what double can hold. Smallest double is about 1e-308. When I write such a number to file, it is written as 1e-311. Then other software like vtk hav…

---

## [Out intent error on \[\] real versus real confusion](https://chapel.discourse.group/t/out-intent-error-on-real-versus-real-confusion/49006)

<div class="topic-metadata">

**Author:** [@nelsonluisdias](https://chapel.discourse.group/u/nelsonluisdias)\
**Replies:** 4\
**Last updated:** [April 28, 2026, 9:18pm UTC](https://chapel.discourse.group/t/out-intent-error-on-real-versus-real-confusion/49006 "2026-04-28T21:18:36Z")

</div>

The code below, const nC = 5; var xbar,ybar: \[1..nC\] real; for C in 1..nC do { // ----------------------------------------------------------------- // The eigenvalues. // ---------------------------------------…

---

## [Exponentiation to an integral param power in a param](https://chapel.discourse.group/t/exponentiation-to-an-integral-param-power-in-a-param/42468)

<div class="topic-metadata">

**Author:** [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Replies:** 12\
**Last updated:** [April 23, 2026, 12:07pm UTC](https://chapel.discourse.group/t/exponentiation-to-an-integral-param-power-in-a-param/42468 "2026-04-23T12:07:54Z")

</div>

I noticed that the exponentiation operator of a param to a param power is a not a param operation. I will see what I can do to rectify this at some stage if others think it worthwhile. While it is obvious from the docum…

---

## [Algebraic Data Type (ADT)](https://chapel.discourse.group/t/algebraic-data-type-adt/48581)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 7\
**Last updated:** [March 27, 2026, 10:55pm UTC](https://chapel.discourse.group/t/algebraic-data-type-adt/48581 "2026-03-27T22:55:39Z")

</div>

I only noticed a very tiny description of union types in the language specification, which makes me think Chapel unions are more like C unions than Rust enumerations. Is this right? Is there a good/canonical way to emula…

---

## [Recursion in Chapel](https://chapel.discourse.group/t/recursion-in-chapel/48664)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 3\
**Last updated:** [March 27, 2026, 2:29pm UTC](https://chapel.discourse.group/t/recursion-in-chapel/48664 "2026-03-27T14:29:44Z")

</div>

For the first time I am writing a recursive parallel code in Chapel and it seems to send the compiler (both 2.7 and 2.8) into an endless loop repeatedly printing out the 1 statement: “stoneNetr.chpl:172: called as const…

---

## [AI in Discourse: keep or disable?](https://chapel.discourse.group/t/ai-in-discourse-keep-or-disable/48226)

<div class="topic-metadata">

**Author:** [@bradcray](https://chapel.discourse.group/u/bradcray)\
**Replies:** 7\
**Last updated:** [March 10, 2026, 5:55pm UTC](https://chapel.discourse.group/t/ai-in-discourse-keep-or-disable/48226 "2026-03-10T17:55:24Z")

</div>

Hello Chapel Users and Developers — A few Chapel community members have recently proposed turning off some of the AI features that are enabled in Discourse by default, such as the "summarize" button on discussions. H…

---

## [Integer Promotion Weirdness](https://chapel.discourse.group/t/integer-promotion-weirdness/33886)

<div class="topic-metadata">

**Author:** [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Replies:** 35\
**Last updated:** [March 8, 2026, 2:49am UTC](https://chapel.discourse.group/t/integer-promotion-weirdness/33886 "2026-03-08T02:49:47Z")

</div>

Consider the following: The compile time routine bias() returns an unsigned iinteger. It is passed a real(?w) type const z = 25:uint(32); const y = z + 1; const b = bias(real(32)); const…

---

## [Is the use of proc main() { ... } recommended?](https://chapel.discourse.group/t/is-the-use-of-proc-main-recommended/48096)

<div class="topic-metadata">

**Author:** [@nelsonluisdias](https://chapel.discourse.group/u/nelsonluisdias)\
**Replies:** 5\
**Last updated:** [February 26, 2026, 8:41pm UTC](https://chapel.discourse.group/t/is-the-use-of-proc-main-recommended/48096 "2026-02-26T20:41:22Z")

</div>

Hello! I wonder if there are recommendations, best practices, etc., regarding the use of proc main() { ... }. I almost never use it, and it is clear that I will need it if I want my program to return an exit status, bu…

---

## [Atomic min and max](https://chapel.discourse.group/t/atomic-min-and-max/47969)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 7\
**Last updated:** [February 23, 2026, 11:47pm UTC](https://chapel.discourse.group/t/atomic-min-and-max/47969 "2026-02-23T23:47:46Z")

</div>

I need to compute the minimum of a bunch of floating point numbers, but I only need the actual minimum if the number is bigger than 0.5 (say). I anticipate that most of the time the number will be less than 0.5, so I wou…

---

## [Manage statement exitContext with try-catch?](https://chapel.discourse.group/t/manage-statement-exitcontext-with-try-catch/47921)

<div class="topic-metadata">

**Author:** [@jmag722](https://chapel.discourse.group/u/jmag722)\
**Replies:** 4\
**Last updated:** [February 23, 2026, 1:21pm UTC](https://chapel.discourse.group/t/manage-statement-exitcontext-with-try-catch/47921 "2026-02-23T13:21:37Z")

</div>

Hello everyone, I’m working on a PR for #17277 to add a way to assert if a procedure throws an error, and I think the standard idea with a proc assertThrows(someProc, errType: Error?, ...args?) will work well. But I t…

---

## [Sortperm](https://chapel.discourse.group/t/sortperm/47418)

<div class="topic-metadata">

**Author:** [@00shiv](https://chapel.discourse.group/u/00shiv)\
**Replies:** 15\
**Last updated:** [February 20, 2026, 6:41pm UTC](https://chapel.discourse.group/t/sortperm/47418 "2026-02-20T18:41:55Z")

</div>

I know that there is a sort module with the ability to sort arrays/lists. Is there a “sortperm” function (to use the Julia term for it), that rather than sorting the array returns the resulting permutation instead? Than…

---

## [Stdout "not equal to itself"?](https://chapel.discourse.group/t/stdout-not-equal-to-itself/46825)

<div class="topic-metadata">

**Author:** [@nelsonluisdias](https://chapel.discourse.group/u/nelsonluisdias)\
**Replies:** 5\
**Last updated:** [January 12, 2026, 7:00pm UTC](https://chapel.discourse.group/t/stdout-not-equal-to-itself/46825 "2026-01-12T19:00:18Z")

</div>

Hello: I would expect the code below, use IO; var f = stdout; f.writeln("hello"); again(f); proc again( const in g: fileWriter(true) ) { if g == stdout { g.writeln("hello again"); } } to print two lin…

---

## [More on C strings and interoperability](https://chapel.discourse.group/t/more-on-c-strings-and-interoperability/46841)

<div class="topic-metadata">

**Author:** [@rmason](https://chapel.discourse.group/u/rmason)\
**Replies:** 3\
**Last updated:** [January 5, 2026, 7:17pm UTC](https://chapel.discourse.group/t/more-on-c-strings-and-interoperability/46841 "2026-01-05T19:17:06Z")

</div>

Hello, I think I’m being obtuse about this, in which case please forgive me. I still can’t figer out how to send an array of strings to C. This is my latest attempt. twostring.chpl: use CTypes; extern proc myprint(…

---

## [Ref members of class/record](https://chapel.discourse.group/t/ref-members-of-class-record/46782)

<div class="topic-metadata">

**Author:** [@jmag722](https://chapel.discourse.group/u/jmag722)\
**Replies:** 11\
**Last updated:** [January 5, 2026, 7:08pm UTC](https://chapel.discourse.group/t/ref-members-of-class-record/46782 "2026-01-05T19:08:53Z")

</div>

Came across the message today: "References cannot be members of classes or records yet." Is there a status for this feature? Github issue? It would be nice for constructing large custom data structures (trees).

---

## [Using the \`transmute\` feature](https://chapel.discourse.group/t/using-the-transmute-feature/46663)

<div class="topic-metadata">

**Author:** [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Replies:** 3\
**Last updated:** [December 19, 2025, 5:28pm UTC](https://chapel.discourse.group/t/using-the-transmute-feature/46663 "2025-12-19T17:28:50Z")

</div>

Should an example of the use of the transmute feature be useful, one such example is to deliver the fractional and integral parts of a real(w) number, the modf() function in C. Returning the result as a tuple of two real(…

---

## [Does \`fma\` belong in AutoMath](https://chapel.discourse.group/t/does-fma-belong-in-automath/46676)

<div class="topic-metadata">

**Author:** [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Replies:** 4\
**Last updated:** [December 12, 2025, 12:22am UTC](https://chapel.discourse.group/t/does-fma-belong-in-automath/46676 "2025-12-12T00:22:11Z")

</div>

One could say AutoMath contains only mandatory functionality of the IEEE 754 floating point standard and Math contains the recommended stuff. Well almost. IEEE 754 regards fma() as a fundamental operation, like abs() an…

---

## [Passing an array of strings to C](https://chapel.discourse.group/t/passing-an-array-of-strings-to-c/46463)

<div class="topic-metadata">

**Author:** [@rmason](https://chapel.discourse.group/u/rmason)\
**Replies:** 3\
**Last updated:** [December 5, 2025, 7:02pm UTC](https://chapel.discourse.group/t/passing-an-array-of-strings-to-c/46463 "2025-12-05T19:02:53Z")

</div>

Hello, I need to pass an array of strings to an extern C function. I’m starting by working out how to populate such an array in chapel. This code: use CTypes; param count: int = 10; var x: c\_array(c\_int, count); if …

---

## [Interoperability: argv\*\[\]](https://chapel.discourse.group/t/interoperability-argv/46377)

<div class="topic-metadata">

**Author:** [@rmason](https://chapel.discourse.group/u/rmason)\
**Replies:** 6\
**Last updated:** [December 5, 2025, 6:12pm UTC](https://chapel.discourse.group/t/interoperability-argv/46377 "2025-12-05T18:12:23Z")

</div>

Hello, I need to pass an argument corresponding to C’s argv\* from chapel to C. In my chapel code I have this: extern proc plot(argc: c\_int, argv: c\_ptr(c\_ptr(c\_char)), x: \[\] c\_double, y: \[\] c\_double, xmin: c\_double, x…

---

## [Math.isClose Promotion Support](https://chapel.discourse.group/t/math-isclose-promotion-support/46291)

<div class="topic-metadata">

**Author:** [@jmag722](https://chapel.discourse.group/u/jmag722)\
**Replies:** 6\
**Last updated:** [December 2, 2025, 5:37am UTC](https://chapel.discourse.group/t/math-isclose-promotion-support/46291 "2025-12-02T05:37:21Z")

</div>

I was curious why Math.isClose does not support element-wise operation on arrays? Looking at the source it explicitly rejects arrays. My only thought was because there was ambiguity on whether or not the function should…

---

## [Windowing Toolkit Interface supporting 3D graphics](https://chapel.discourse.group/t/windowing-toolkit-interface-supporting-3d-graphics/46288)

<div class="topic-metadata">

**Author:** [@damianmoz](https://chapel.discourse.group/u/damianmoz)\
**Replies:** 4\
**Last updated:** [November 26, 2025, 3:09am UTC](https://chapel.discourse.group/t/windowing-toolkit-interface-supporting-3d-graphics/46288 "2025-11-26T03:09:40Z")

</div>

Is there such an interface for Chapel? Not talking about FLTK. Only needs to be C, e.g. Tk. Thanks

---

## [UnitTest project directory structure for libraries and submodules?](https://chapel.discourse.group/t/unittest-project-directory-structure-for-libraries-and-submodules/46243)

<div class="topic-metadata">

**Author:** [@jmag722](https://chapel.discourse.group/u/jmag722)\
**Replies:** 7\
**Last updated:** [November 21, 2025, 2:57am UTC](https://chapel.discourse.group/t/unittest-project-directory-structure-for-libraries-and-submodules/46243 "2025-11-21T02:57:32Z")

</div>

Hello, I had a question about project file structure for a Chapel library. I’m confident I have the src directory structure working, per the great discussion in Importing files from subfolders . I’m assuming: src/ MyL…

[Next page](https://chapel.discourse.group/c/users/6.md?page=1)
