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

Wanted articles #49

Open
9 of 37 tasks
markknol opened this issue Aug 12, 2016 · 5 comments
Open
9 of 37 tasks

Wanted articles #49

markknol opened this issue Aug 12, 2016 · 5 comments

Comments

@markknol
Copy link
Member

markknol commented Aug 12, 2016

If you are in the mood for writing but don't know what, then you can use this list:

  • Beginner - Lists and Arrays
  • Beginner - Using Regular Expressions
  • Beginner - Using Math
  • Beginner - Using abstract
  • Beginner - Using enum / ADT
  • Beginner - Using strings
  • Beginner - Using numbers
  • Beginner - Type parameters and generics
  • Beginner - Using FileSystem - add section about Path
  • Using Sys stuff to write command line tools
  • Using sys.io.Process
  • Pattern Matching examples
  • How to use Array Access
  • How to type Json using typedefs
  • Examples of expression reification
  • Examples of type reification
  • Examples of class reification
  • Using HXML (https://blog.onthewings.net/2013/03/04/hxml-tricks-every-haxe-user-should-know/) this is in manual now
  • Mainloop / Timing / Delays / Intervals
  • Using Haxe to make backend API
  • Using Haxe to make command line tool
  • Using Haxe to make static websites (like code.haxe.org 😉)
  • onAfterGenerate
  • JavaScript: macro --include to bundle external js files
  • JavaScript: Use promises
  • JavaScript: How to use/manipulate DOM
  • JavaScript: Use canvas
  • JavaScript: Use webGL
  • JavaScript: Use camera
  • JavaScript: Get location
  • JavaScript: Send notifications
  • JavaScript: Use virtual dom
  • JavaScript: Output ES6
  • JavaScript: Split output https://github.com/elsassph/haxe-modular
  • JavaScript: Use local storage
  • JavaScript: Minify / get smallest output / make project production ready https://github.com/back2dos/closure or uglify
  • Make simple game

Btw, these titles are suggestions. This list will get updated over time.

@nadako
Copy link
Member

nadako commented Aug 12, 2016

How to type Json using typedefs

This one is quite "funny". We even have such example in the manual, but in fact, it's not really safe when it comes to arrays on static targets, e.g.:

var a:Array<Int> = haxe.Json.parse("[1,2,3]")

This compiles (because of Dynamic) but might either fail at runtime or introduce hidden copy-casting, because haxe.Json.parse parses arrays to Array<Dynamic> which isn't really the same as Array<Int> on targets like C# and C++ which try to implement arrays in an efficient way for basic types.

So nowadays I'm doubting that this is something we should promote. At least we should note that particular issue so people are aware of it.

I think @hughsando dealt with this somehow for the newer hxcpp, but this is still an issue in C# (without -D erase-generics).

@dstrekelj
Copy link
Contributor

Alright, seems doable.

But I'm still waiting on someone to approve or review the Stack Overflow documentation changes I proposed! ;)

@azrafe7
Copy link

azrafe7 commented Apr 4, 2017

A couple more things (that I think are highly needed):

  • handling of utf8/unicode strings
  • advanced regexes (and how they differ from other languages)

@azrafe7
Copy link

azrafe7 commented Jun 17, 2017

I have another request: more macro-related stuff. 👍

As of writing I'm in the process of trying to learn them, and have found myself with tens of tabs open from various sources (manual (new and old)/blog posts/articles/libs). All of them helpful! But infos are scattered around, and I find myself jumping back and forth trying to collect the missing pieces.

The code cookbook has been particularly helpful so far, I just really wish it had more examples. Please! 😛

So... here's a little list of some of the difficulties/confusing-moments I've faced so far (hoping it can serve as hint for more enlightening snippets):

  • in many examples (around the web) variables are not type-hinted, and that makes hard to grasp what the inferred type is
  • related to the previous point: using the various macro.*Tools without mentioning them in comments makes it harder to understand the code
  • Type vs ComplexType
  • confusion about TAnonymous (same name, but present in different modules)
  • macro keyword vs macro define (what's the relation, when it's NEEDED to use the keyword, etc.?) (I currently use a trial&error approach: run the compiler until it works, and then analyse the output)

As I said, I've just recently started to make sense of the powerful macro system, and I think that learning from useful examples is the best way.

PS: Someone may object that my points are material for StackOverflow or the MailingList. I agree, but having them explained clearly in the official cookbook is a plus (SO and ML could still link to them).

@markknol
Copy link
Member Author

Those are helpful ideas, thanks! If you want to contribute to one of those topics,feel free to add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants