Repository navigation
What don't you like about V / what would you like to be changed? #7610
Replies: 225 comments 880 replies
What i like:
What should be changed imho:
i hope i covered everything. otherwise i will extend this list. |
|
@danieldaeschle's list is quite well, however I still have a few things to ask for For V itself:
For vlibThis portion could be done after 0.3 as no syntax changes are needed. Just wanted to see your opinion.
|
|
I would request you to reconsider default function arguments. It has a lot of utility while avoiding code duplication. This will specially help as there is no function overloading. This will also make the standard library less bloated. |
|
My very subjective ideas are: //A constants declaration to be //B << operator // C logical operators to be |
|
Something like pythons |
|
What are you thinking about chained comparison? |
|
Why not initialize with simple = automatically at first appearance, instead of requiring := ? A thing that I find somewhat contradictory is to need types "after varname", except when using mut, which has to be "before varname". Why not let the types come before or after the var name, as a user choice rather than a required order? |
|
hello all, really thanks for the excellent language! I am working on Linux kernel (with real-time extension: Preempt-RT or Xenomai )and driver development for hard real-time control system, so I hope V to be a "modern C", can 100% replace C in low level , the first layer over hardware. the missing part:*) Data structure alignment: support enforce data structure padding&packing&align manually. This feature is need due to hardware's register are fixed already, software need follow the hardware spec when define a struct/array for register set. Also need by cache line fits. https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Common-Type-Attributes.html#Common-Type-Attributes *) sperate API for creation of real threads and co-routine: real threads are needed by time critical code (e.g. hard realtime OS); co-routines are for non-realtime code. nice to have if possiable:*) stack size estimation at compile time: maybe with certain limits (e.g. don't allow variable logic arrays, disable recursion...), stack size can be estimation at compile time, avoiding stack overflow and gain good performance by avoiding dynamic stack size allocation (as Go's design); performance is important for hard real-time system (Preempt-RT Linux, Xenomai, Vxworks and other RTOS), latency/jitter is < 10us on a fine tuned x86_64 CPU, so they need avoid dynamic memory allocation in the realtime loop. various embedded system with small memory may also benefits. Thanks & best regards, fino/ |
|
My personal list from what I've found playing around, beyond what I've seen above:
A bit more iffy:
|
|
'Gated' arrays a:='0123456789'
assert a#[..20]=='0123456789' // true
assert a#[-20..]=='0123456789' // true
assert a#[-4..20]=='6789' // true
assert a#[20..]=='' // true, it never return an error, it return an empty array.
a[-4..20] ==> ERROR
a[20..] ==> ERROR // without gate symbol the behaviour will be the usuallywhere the |
|
Struct Memory Layout Struct A{
a int
b int
}
Struct B{
a f32
b int
}
v1 := A{b:1} // A b's displacement in memory is 4
v2 := B{b:1} // B b's displacement in memory is 4This feature is needed to use V for low level in OS and system programming |
|
It would be nice if you could do something like |
|
[fixed]
mut arr := []int{ 2, 0 }
arr[0] = 4 // valid
arr << 4 // compile error |
|
I know this might create a heated discussion, but I'd love to be allowed to use . I know this is against the "one way to do things" philosophy and I completely understand that point of view and the reasons for not allowing this, but I think most people are used to doing it this way and probably all or most new V developers will run into this 'feature' of V. We're a team and just checking if V is for us, and all of us are annoyed by this behaviour. In our opinion it also makes sense to wrap a condition in brackets. By the way, why is this possible: ? The brackets aren't necessary - but they do improve readability. And I know cases where there will be an improvement to readability when you wrap one single condition in brackets as well. So I propose: Please allow brackets around conditions, even if they are not necessary. Thank you a lot for that nice language nevertheless! |
|
Feature request: Overloadable array indexing numpy's If a struct could overload indexing, that would make great syntax for a version of Example syntax: voxels := ndarray([1,2,3,4,5,6,7,8,9], [3,3,3])
assert voxels[0,0,0] == 1
assert voxels[0,0,1] == 2
assert voxels[0,0,2] == 3
assert voxels[0,0,0..2] == [1,2,3]For serialization, you often need to support runtime editable strides/offsets, which limits the amount of compiler magic one can do. |
|
All access and transformations on object2 are via function calls into a module and only that module knows how its implemented, I as a mere user of the object, do not care how it is implemented. |
|
I want to organize the syntactic sugar of other languages (such as JavaScript, Python, Go, Rust, etc.) and propose adding the useful parts to the V language. |
|
Here are all the features I came up with that I consider useful.
|
|
I think the compiler should enforce initialization of "sum types", since it is very easy to inadvertently change the order of addition, resulting in an unpredictable behavior. type MyType = string | int
x := MyType{}
println(x) // MyType('')
type MyType = int | string
x := MyType{}
println(x) // MyType(0) |
|
I would like to request that the json encoder recognize I would like this code to run: @[json: 'mything']
struct Structure {
name string
}
k := Structure{'foo'}
str := json.encode(k)
assert str == `{"mything": {"name": "foo"}}'
l := json.decode(Structure, test_]str) or { Structure{"FAILURE"} }
assert l.name == "foo"A more complex example, this would en/decode: |
|
Comptime match: |
|
We need a internal primary type |
|
Vscode extension for syntax highlighting to work better |
|
I like v have more functions to gg module, add high level api such as: is_screen_touch(touch_id), is_screen_draging, ... to gg module , have music module like sonic pi (https://sonic-pi.net/), and module to create some beautiful vfx for game like explosion, fire, smoke, spark, magic, ... |
|
VUI needs more attention, particularly as a featured module on the front page and as something new users would obviously look at. Even just updating the roadmap, would be a good gesture. |
|
I'd like to see PREG2 as the standard RE engine (no other libraries tolerated). |
|
It is hoped that v can reserve space for a borrowing checker similar to rust, so that v can have its own borrowing checker at some point in the future. |
|
Since lambdas are implemented, is there any chance to remove magic variables such as |
|
V After implementing the optional Rust-like borrow checker. |
|
Sad to say, but think the VUI and GUI situation is frustrating, despite how good the potential of both are. Before I go on, want to make it clear that Mike is doing a monumental and fantastic job. VUI and GUI have different strengths and weakness. They each do somethings better than the other, but are not complete replacements for each other. I suppose having both is not a problem, as many languages do have multiple options for UIs. VUI's percentage based box_layout is a hidden gem and fantastic for very quickly building UIs and also rearranging them afterwards. Works on Windows and "kind of sort of" on Android (when tested some time ago), in addition to macOS and Linux. Arguably, in a more advanced state of development, but has stalled. Additionally, many have invested time or coded some things using it. GUI, utilizing Clay, has: an updated look, thread-safe UI updates, easier view changing, and high development pace. However, Mike has made it clear, that neither Android or Windows is a priority. Both are arguably not yet ready, which is more an issue for VUI (because of age). But both are likely to be among the first modules looked at, for many new to the language. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
After
0.40.6, we'll be going for 1.0 right away, freezing the syntax, similar to what Go did.So if something has to be changed, now is the time to do it.
Please post your criticisms of V, there's a good chance that things you don't like will be fixed/improved.
All reactions