The or_return operator forces me to propagate errors, which I absolutely do not want. During the prototyping process, it is extremely important to accurately determine the location of the failure and its cause. You can, of course, use the if err != nil do log.panic(err) construction, but wasn’t the or_return operator created for such cases? It seems to me that having the or_panic operator would be a great solution to that problem. And also it would be very symmetrical to other operators.
I know there’s labelled breaks, I use them extensively. They still don’t exhaust all possible control flow that goto allows.
For slices, at that point I may as well just use len(slice) and raw_data(slice) since that’s less typing than transmuting.
It’s one thing to get a handle on a union’s tag value, it’s another to actually have compile time semantics regarding it, or having things perhaps like a bit set or an enumerated array keyed to a tagged union’s tag.
How can you miss something that never existed? I made foo() or_else panic(...) work instead which is a lot clearer and more consistent.
or_return doesn’t “force” you to propagate errors at all. You are literally choosing to use it in the first place. If you don’t want to use or_return, do not use it. Nothing in the language is “forcing” you to use it one bit.
You cannot do that with any of the or_* constructs, and that’s because an explicit if statement is a lot clearer too. if statements show the clarity of the control flow and values for such operations.
ZLib’s license could probably be used, but it comes down to BSD-1-Clause probably in favor of simplicity and explicitness, and people’s familiarity with the BSD license complex.
BSD-Source-Code looks like a perfect fit, kind of.
Copyright (c) <year>, <author>
All rights reserved.
Redistribution and use of this software in source and binary forms, with or without modification, are permitted
provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this list of conditions and the
following disclaimer.
* Neither the name of <project> nor the names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Apache 2.0 + LLVM exception - for no requirement of attribution in binary and patent protection. (MSVC STL)
BSL 1.0 - same as above except it does not have patent protection. (dlang libs)
It is an old one of mine, but I kind of feel that sometimes odin feels a bit surprising. It is definetely not as bad as other modern languages, but sometimes without knowing what’s happening behind the scenes it feels like lost opportunity. For example, function pointers can’t be truly made distinct. There’s probably a good reason for that but still is something that wanders around in my mind.
“Go To Statement Considered Harmful” - Edsger W. Dijkstra, Communications of the ACM, 01 March 1968.
“Exceptions — And Why Odin Will Never Have Them” - Ginger Bill, gingerbill.org, 2018-09-05
Like exceptions, gotos improve a programming language by their absence.
If you need a more complicated control flow construct, perhaps you should consider writing that portion of your program in a different language? I believe C still allows goto and setjmp/longjmp.
If you need a more complicated control flow construct, perhaps you should consider writing that portion of your program in a different language?
It feels a strange thing to ask Kris to do on a thread asking what about Odin he doesn’t like.
I feel this response is more appropriate would he be asking how to replicate goto in Odin and not just expressing dissatisfaction with something in Odin, as per the prompt.
I personally dislike the vagueness in the boost license (and MIT). BSD typically differentiates clearly between source and binary, where MIT/boost calls it ‘the Software’ - and in my mind I am falling back to “Software in which form? all forms? When is ‘the Software’ another product?” BSD is a lot more digestible in comparison imo.
That being said, I’m favoring 0BSD.
edit: we should evaluate opening another thread for that, no :X
The lack of a proper documentation tool and standard for comments.
I know there is a tool and standard for the official packages but it requires 500mb of downloading assets.
At least Odin provides comments and markdown parsing in the official tools. So right now I am working on scratching this itch