Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example: change_color_by_id #20519

Merged
merged 3 commits into from Jan 14, 2024

Conversation

enghitalo
Copy link
Contributor

@enghitalo enghitalo commented Jan 13, 2024

Why?

  • Smaller than mandelbrot
  • Better string manipulation
  • HTML elements manipulation (Js using V function)

Discussion

Would be cool have some template processing when using wasm

@v 'change_color_by_id.wasm.v' Would compile change_color_by_id.wasm.v file and generate the actual script with all public function

Might following the logic bellow

     @for func in v_functions
            @func.name = res.instance.exports["${func.mod_name}.${func.name}"];
      @end

like

reflection
    .get_funcs()
    .filter(it.mod_name == "main")
    .map(fn (f reflection.Function) string {
		return "${f.mod_name}.${f.name}"
	})

@spytheman
Copy link
Member

The CI failure is not related.

Copy link
Member

@spytheman spytheman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excellent example.

@spytheman spytheman merged commit cb22407 into vlang:master Jan 14, 2024
41 of 42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants