Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 12:51
    pushqrdx edited #176
  • Jan 31 2019 12:51
    pushqrdx edited #176
  • Jan 31 2019 10:18
    pushqrdx opened #176
  • Jan 31 2019 07:20
    pushqrdx commented #169
  • Jan 31 2019 01:04
    iamtirado commented #169
  • Jan 29 2019 22:04
    shreeve commented #175
  • Jan 29 2019 13:09
    somebee closed #173
  • Jan 29 2019 13:09

    somebee on master

    Reset Stack.tag before each com… Bump version to 1.4.2 (compare)

  • Jan 29 2019 12:24

    somebee on master

    Lookup event handlers up the ow… (compare)

  • Jan 29 2019 12:23

    somebee on master

    Reset rewriter between runs Merge branch 'master' of https:… (compare)

  • Jan 29 2019 07:40
    shreeve opened #175
  • Jan 28 2019 21:26
    shreeve closed #174
  • Jan 28 2019 21:26
    shreeve commented #174
  • Jan 28 2019 21:24
    shreeve edited #174
  • Jan 28 2019 21:24
    shreeve opened #174
  • Jan 27 2019 14:37
    darcyturk opened #173
  • Jan 27 2019 10:04
    darcyturk commented #128
  • Jan 26 2019 11:56
    Alhadis opened #172
  • Jan 22 2019 01:29
    CassianoSF closed #171
  • Jan 22 2019 01:29
    CassianoSF commented #171
Alexander Alemayhu
@scanf
What should the Imba v2 slogan be?
Fedor Leschinsky
@altteo
The web-language you will love :)
Alexander Alemayhu
@scanf
:+1:
Eric Vida
@ericvida
@scanf I figured out svg's http://chico.tirado.app
Can I bind an input value to a parent's prop with
<input[#context.search]>?
Sindre Aarsaether
@somebee
Nope - I dont think so, but you can send it in using a special bind syntax.
Will whip up an example
Sindre Aarsaether
@somebee
@iamtirado you can bind props using this syntax: https://scrimba.com/c/c4Pa8ysL
Might change though
but this allows us to use the form bindings in wrapped components etc
Eric Vida
@ericvida
that's perfect.
Eric Vida
@ericvida

Can anyone help me convert this fuzzy search function to imba syntax? I'm getting too many errors. Maybe someone can help me do it well. I'm not sure how to get around the outer part.

'use strict';

function fuzzysearch (needle, haystack) {
  var tlen = haystack.length;
  var qlen = needle.length;
  if (qlen > tlen) {
    return false;
  }
  if (qlen === tlen) {
    return needle === haystack;
  }
  outer: for (var i = 0, j = 0; i < qlen; i++) {
    var nch = needle.charCodeAt(i);
    while (j < tlen) {
      if (haystack.charCodeAt(j++) === nch) {
        continue outer;
      }
    }
    return false;
  }
  return true;
}

module.exports = fuzzysearch;

```

Here's my attempt: https://scrimba.com/c/cD7QnBuv
Sindre Aarsaether
@somebee
We dont support labeled loops ATM - but it could be implemented with a slightly different approach. Will post when at my computer
Sindre Aarsaether
@somebee
Not sure if it works - i found quite a few errors :) But you can at least check it out
Not sure if we will support labeled loops and continue/break (label name). Much more powerful to be able to continue and break with values (see bottom examples here https://www.imba.io/guides/language/loops#loops)
Eric Vida
@ericvida
Thanks for the example. I had never seen that the labels being used in Imba. I thought that might be it.
But i didn't know how to work around it.
Great examples in the docs too. i need to understand those better.
useful stuff
Eric Vida
@ericvida
What's the proper way to export and import a module? I can't get it to work.
Shouldn't I be able to do
---- fuzzySearch.imba
export fuzzySearch needle, haystack
        ...
---- app-root.imba
import fuzzySearch from './fuzzySearch.imba'
console.log fuzzySearch("one", "two")
using the imba2-hello-world example
Sindre Aarsaether
@somebee
Expert def fuzzy...
And import {fuzzy...}
See import/export on MDN. The syntax is basically the same
Cassiano Surdi Franco
@CassianoSF

Have you seen this? https://externos.io/

I think this could be a good showcase for imba, going to try it this weekend.

Eric Vida
@ericvida
thanks @somebee. I had a misspelling in import.
and missing curly braces
Fedor Leschinsky
@altteo
@somebee watch from 5:30 https://youtu.be/c0oy0vQKEZE about private class properties. There are interesting things also after that.
Also just found out that a month ago Microsoft Edge (previosly known as IE) fully switched to chrome stack (blink + v8) and now they work the same. Minus one compatibility headache.
André Kaufmann
@akaufmann
Hi, is there a way to see the compiled output on Scrimba like in the Svelte repl? If not can fill an issue somewhere - https://github.com/scrimba/community/issues?
Bildschirmfoto 2020-02-22 um 11.42.11.png
Sindre Aarsaether
@somebee
‘cmd+j’ is a secret shortcut for compiling the imba code and adding the compiled output as a comment below
André Kaufmann
@akaufmann
Ah, nice :smiley: Thanks Sindre!
Alexander Alemayhu
@scanf
GitBook looks mostly fine but two things do suck. i) No syntax highlighting ii) Forgetting to hit the save button when editing.
I think the first one we could solve by using a server app that can render imba code examples as images. Similiary to what imba.io does with markdown but is this overkill?
I can get used to black and white but does it give a bad impression for beginners?
Eric Vida
@ericvida
i think using the ruby syntax highlighting is somewhat better than none. I felt like it gave a mostly consistent highlighting for imba.
Fedor Leschinsky
@altteo
You can also try python
Sindre Aarsaether
@somebee
It seems obvious that we’re going to move the docs to our own thing in a couple of months. Lets use gitbook until we’re satisfied with the content, and then roll our own thing :)
Eric Vida
@ericvida
oh yeah
cstffx
@cstffx

This code

while true
    const a = 10
    break

while true
    const a = 10
    break

compile to

while(true){
    const a = 10;
    break;
}

while(true){
     a = 10;
     break;
}

I expected the second "a" to be const a = 10 too. Is this normal?

This was on imba 1
Sindre Aarsaether
@somebee
are consts block scoped_
cstffx
@cstffx

They are inside a function. Is this what you mean?

But withlet it is as I expected

while true
    let a = 10
    break

while true
    let a = 10
    break

Compile to

while(true){
    let a = 10;
    break;
}

while(true){
    let a = 10;
    break;
}
Fedor Leschinsky
@altteo
I have an unhealthy desire to rewrite compiler from scratch. @somebee What would you say?
Sindre Aarsaether
@somebee
I say it is needed :P but not something I have time to do :)