4 ms·
Couple thoughts/questions in no particular order: --- If arrays are passed by reference, how does the bounds-checking code deal with aliasing? For instance (a
by al2o3cr 4y ago
Couple thoughts/questions in no particular order:
---
If arrays are passed by reference, how does the bounds-checking code deal with aliasing? For instance (apologies if this syntax is wrong):
munge_arrays(int n, int[] a, int[] b) {
if (n < 0) || (n >= b.size)
return
a.Pop()
return b[n]
}
// good callsite
first_array := [1,2,3]
second_array := [4,5,6]
munge_arrays(1, first_array, second_array)
// callsite
target := [1,2,3,4]
result = munge_arrays(target.size-1, target, target)
The "Array Bounds" section on the "Highlights" page suggests that the compiler will try to spot indexing errors (like accessing target[target.size]), but thanks to aliasing b can change size "at a distance" if the right parameters are passed to munge_arrays.
---
What are the scoping rules for enum and bitflag names? The page in the Quick Start is unclear - sometimes they are qualified with the type name (Fruit.Apple) but not always (Banana, Dir farther down). Is this like Haskell records where every name has to be globally-unique?
---
Similar question for "extend" - the last couple lines of the "Struct and Class" page hint at a feature, but it's unclear what the scope of extension is. Is that based on the type of the first argument of the function being extended (Test in this case)?
---
One more scoping question: what names are in scope in an _OnBreak clause? For instance, in the nested part of the "LoopsWithExits" example, can that inner _OnBreak see v2?
---
How does constructing an instance of a class with arguments work (if at all)? The examples of constructor() functions are all arity zero, is the intent that an instance be constructed "blank" and then subsequently mutated?
---
One feature notably absent from the examples is passing functions as parameters. For instance, is it possible to write a "mapIntArray" function that takes an "int[]" and a function (that takes an int and returns an int) then returns the result of applying the function to each element of the array?
---
Has features not found in any other language
IMO you should either list them, or change the marketing language. I'd recommend the latter - people don't pick languages because they have unique features, they pick them because they NEED what the unique features help them accomplish. What's some code that Bolin makes easier/clearer/safer/whatever to write?
---
(e) Licensee shall not publish or disclose to any third party the results
of any benchmark tests or other evaluation run on the Software without the
prior written consent of DeLellis.
Is this 1994? Did I accidentally click on a link to Oracle.com? If I downloaded the software and did some experiments to answer my own questions above, would I have to ask for PERMISSION to post the results?
You want "the community" to contribute feedback and ideas for free, but you want to retain absolute control over both the software and the conversation. That's not a good trade.
- levodelellis 4y agoIronically enough I do want people to benchmark Bolin. It's very performant. I didn't want to modify the EULA and accidentally put a hole in it. I'll definitely have a new one when the compiler gets to 1.0 The compiler should complain about aliasing but I should check when I get home. The problem here is array's have an invalidation function (it may resize and the pointer may change). It's not allowed to have aliases. If the compiler knows what type is expected (for the enum/bitflag) it can figure out the value. 2. No, its highly dependent on knowing the type. Yes, first argument. _OnBreak can see the index if you have it but I can't remember if it lets you see v2. It should but I never actually tested it > they pick them because they NEED what the unique features help them accomplish If you read it off a list would you recognize what it does? People in the last 24hrs told me they don't understand why I would want onbreak and didnt notice you can chain breaks so you don't need a goto > That's not a good trade. It's tough. One goal is how to make the developers lives easier. I heard about people quitting their project because of comments over github